Bug 218502 - event loop exception starting mozilla
Summary: event loop exception starting mozilla
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Grant Gayed CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-02-11 09:16 EST by Michael Stevens CLA
Modified: 2008-03-03 12:22 EST (History)
0 users

See Also:


Attachments
eclipse configuration (238.13 KB, text/plain)
2008-02-11 09:17 EST, Michael Stevens CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stevens CLA 2008-02-11 09:16:30 EST
Error when using datatools - I think it may have been trying to start a browser.

Duplicate detection on stack trace shows no matches.

Guessing at SWT component.

-- Error Log --
Date: Mon Feb 11 14:07:27 GMT 2008
Message: Unhandled event loop exception
Severity: Error
Plugin ID: org.eclipse.ui
Stack Trace:
org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3347 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file)
at org.eclipse.swt.SWT.error(SWT.java:3589)
at org.eclipse.swt.SWT.error(SWT.java:3481)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:324)
at org.eclipse.swt.browser.Browser.<init>(Browser.java:109)
at org.eclipse.datatools.sqltools.plan.internal.ui.view.GraphicsPlanControl.createDetailForm(GraphicsPlanControl.java:90)
at org.eclipse.datatools.sqltools.plan.internal.ui.view.GraphicsPlanControl.init(GraphicsPlanControl.java:72)
at org.eclipse.datatools.sqltools.plan.internal.ui.view.GraphicsPlanControl.<init>(GraphicsPlanControl.java:53)
at org.eclipse.datatools.sqltools.plan.internal.ui.view.PlanView.createPartControl(PlanView.java:119)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:370)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:227)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2086)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1027)
at org.eclipse.ui.internal.WorkbenchPage.access$19(WorkbenchPage.java:1008)
at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3684)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3681)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3657)
at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:165)
at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:109)
at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:239)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:475)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:429)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:165)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:247)
at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:128)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
Caused by: java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3347 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:219)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:309)
... 52 more
Comment 1 Michael Stevens CLA 2008-02-11 09:17:26 EST
Created attachment 89399 [details]
eclipse configuration
Comment 2 Grant Gayed CLA 2008-02-11 09:40:57 EST
Which linux distro do you see this on?  And if it has a xulrunner installed (likely in a place like /usr/bin/xulrunner*), what version is it (run "./xulrunner -version" at the command line to see this)?
Comment 3 Michael Stevens CLA 2008-02-11 09:46:10 EST
Distribution is Centos 5.1. Which is very nearly identical to redhat.

The only xulrunner I could find is:

mstevens@tetra:~
> /usr/lib/esc-1.0.0/xulrunner/xulrunner -version
Mozilla XULRunner 1.8.0.1_0000000000
Comment 4 Grant Gayed CLA 2008-02-14 14:19:44 EST
Can you try:

1. run the snippet below to see which mozilla install it's trying to use (it will be printed to stdout):

public static void main(String[] args) {
	Device.DEBUG = true;
	Display display = new Display();
	Shell shell = new Shell(display);
	new Browser(shell, SWT.MOZILLA);
	display.dispose();
}

2. set your MOZILLA_FIVE_HOME environment variable to this directory
3. go into <eclipse>/plugins and unzip the org.eclipse.swt.gtk...jar plugin
4. ldd the libswt-mozilla...so library, what does this output?
Comment 5 Grant Gayed CLA 2008-02-14 14:20:49 EST
I made a mistake in the last comment, the Browser creation line in #1 should have been:

new Browser(shell, SWT.NONE); // <-- style SWT.NONE
Comment 6 Michael Stevens CLA 2008-02-18 06:13:37 EST
What environment should I run this code in to get all the Eclipse classes visible?
Comment 7 Grant Gayed CLA 2008-02-19 12:37:48 EST
Are you able to start eclipse?  If so:
- create a Java Project and in its properties add the eclipse/plugins/org.eclipse.swt.gtk...jar to its Java Build Path (Library tab)
- create a Java Class with the snippet, Ctrl+Shift+O to resolve the imports

If you can't start eclipse, can you see if you have any files on your machine like /etc/gre.conf or /etc/gre.d/gre.conf, and if so, what is in them?
Comment 8 Michael Stevens CLA 2008-02-21 10:18:04 EST
I get this:

Mozilla path: 
Exception in thread "main" org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3347 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file)
	at org.eclipse.swt.SWT.error(SWT.java:3589)
	at org.eclipse.swt.SWT.error(SWT.java:3481)
	at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:324)
	at org.eclipse.swt.browser.Browser.<init>(Browser.java:109)
	at MozTest.main(MozTest.java:14)
Caused by: java.lang.UnsatisfiedLinkError: no swt-mozilla-gtk-3347 or swt-mozilla-gtk in swt.library.path, java.library.path or the jar file
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:219)
	at org.eclipse.swt.internal.Library.loadLibrary(Library.java:151)
	at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:309)
	... 2 more

I noticed one thing I was doing that's probably stupid.

As a workaround for some long ago problem I was setting:
    export MOZILLA_FIVE_HOME="";

with this removed I get:

Mozilla path: /usr/lib/firefox-1.5.0.12

as output from the test program.

But even so, I'd expect a polite error saying it can't find firefox rather than the rather nasty exception I got.
Comment 9 Grant Gayed CLA 2008-02-21 11:37:55 EST
To confirm, if you don't set MOZILLA_FIVE_HOME to "" does the original problem (comment 0) go away?
Comment 10 Michael Stevens CLA 2008-03-03 10:28:04 EST
Yes, it appears to fix the problem.
Comment 11 Grant Gayed CLA 2008-03-03 12:22:57 EST
Fixed > 0303, a detail is now added to the library loading error message that indicates the MOZILLA_FIVE_HOME that is being attempted to be used by the Browser.  Having this would have been helpful with another report that I recently fixed as well.

You may also wish to open a new report with datatools, because errors that are thrown from the Browser's constructor should be caught by the client as shown in http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet148.java?view=co .  Platforms like Solaris, AIX and HPUX do not have Browser support, and therefore will always throw an error from here, which the client should catch and handle in an alternate way.  The Welcome page and Javadoc view are two places in eclipse where this situation is handled.