[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [atf-dev] Application doesn't find the Xulrunner instance
|
Title: Message
Do
you have problem on Linux ?
Or
windows?
--
Cheers
Philippe
http://easyeclipse.org - http://phpeclipse.net - http://eclipse.org/atf -
http://eclipse.org/vep - http://labs.jboss.org/drools/ - http://developer.mozilla.org/en/docs/XULRunner
Philippe:
Thanks for the
information. I've been digging through the Mozilla.create method and that
works fine. I have a browser editor, much like ATF, that sets up the mozilla
browser. The first two lines are:
final Browser browser = new
Browser(parent, SWT.MOZILLA);
final nsIWebBrowser
webBrowser = (nsIWebBrowser) browser.getWebBrowser();
The webBrowser turns out to be null and, upon
debugging, I find that I get an InvocationTargetException in the
getWebBrowser() method. The relevant code is:
Class clazz = Class.forName ("org.mozilla.xpcom.Mozilla"); //$NON-NLS-1$
Method method = clazz.getMethod
("getInstance", new Class[0]); //$NON-NLS-1$
Object mozilla
= method.invoke (null, new Object[0]);
method =
clazz.getMethod ("wrapXPCOMObject", new Class[] {Long.TYPE,
String.class}); //$NON-NLS-1$
webBrowserObject = method.invoke
(mozilla, new Object[]
{new Long (webBrowser.getAddress ()),
nsIWebBrowser.NS_IWEBBROWSER_IID_STR});
return
webBrowserObject;
The exception happens at line 1258,
webBrowserObject = method.invoke...Of course, there's nothing in the catch
blocks so I have no idea regarding the root cause of the
InvocationTargetException.
So, it's
not in the Mozilla.create method I'm having the problem.
I have no problem if I register the xulrunner
installation via --register-global.
--> Mike Squillace
IBM Human Ability and Accessibility
Center
Austin,
TX
W:512.823.7423
M:512.970.0066
masquill@xxxxxxxxxx
www.ibm.com/able
"Philippe Ombredanne"
<pombredanne@xxxxxxxxx> Sent by: atf-dev-bounces@xxxxxxxxxxx
11/09/2007 12:31 PM
Please respond
to pombredanne@xxxxxxxxx; Please respond to AJAX Toolkit
Framework discussion
<atf-dev@xxxxxxxxxxx> |
|
To
| "'AJAX Toolkit Framework
discussion'" <atf-dev@xxxxxxxxxxx>
|
cc
|
|
Subject
| RE: [atf-dev] Application doesn't
find the Xulrunner instance |
|
Michael A Squillace wrote:
>According to the SWT FAQ, the
XULRunner instance must also be "properly
installed,"
>which means
executing xulrunner.exe with, say, ---register-global.
>http://www.eclipse.org/swt/faq.php#howusemozilla
>Does ATF do
this as well or is this a manual step required by the user?
>If a
required manual step, it would be nice to find a way around it else
having
a
>xulrunner plug-in becomes pointless - ie I might just as well use
any
XULRunner
>installation, right? I know that there has been some
talk of
re-architecting all
>of this so maybe I'm missing something.
Also, apologies if this is a
question
>that would be more
appropriate for the SWT team.
Hey Mike, no it is perfectly
appropriate.
Xulrunner does not have to be registered.
When a Browser
with SWT.MOZILLA style is instantiated, a suitable Xulrunner
is searched,
from the most specific to the least specific.
The code is in the SWt method
Mozilla.create (Composite parent, int style)
here:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Eclipse%20SWT%20Moz
illa/common/org/eclipse/swt/browser/Mozilla.java?revision=1.67&view=markup
The
search sequence is roughly: (check the code for exact details)
- lookup a
xulrunner at the location contained in the System
property:
org.eclipse.swt.browser.XULRunnerPath
- if not defined, try to
initiallized a xulrunner that is registered
(globally or user, usually
global)
- if failing then fallback to the mozilla pointed by the
MOZILLA_FIVE_HOME
envrionment variable.
if everything fails (including
not finding an embeddable mozilla runtine or
xulrunner that is embeddable
and satifies the versions constraints
(GreVersionRange), then
fail.
Therefore the way ATF does it is to provide an extension point
such that:
- we can ship a xulrunner as an OSGI bundle
- the extension
markup points inside that bundle that contains a proper
xulrunner
- the
extension looks that up and if found, creates
the
org.eclipse.swt.browser.XULRunnerPath sys prop. It tries to do that
at
startup time, so that we can be the very first to initialize a
xulrunner.
The first code to instantiates a xulrunner wins. we do for
now.
Then we just instantiate the browser widget when needed, and the
sequence is
that defined in SWT, taking into account our system
property.
--
Cheers
Philippe
philippe ombredanne | 1
650 799 0949 | pombredanne at nexb.com
nexB - Open by Design (tm) -
http://www.nexb.com
http://easyeclipse.org - http://phpeclipse.net -
http://eclipse.org/atf -
http://eclipse.org/vep -
http://labs.jboss.org/drools/
-
http://developer.mozilla.org/en/docs/XULRunner
_______________________________________________
atf-dev
mailing
list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev