Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Eclipse headless on SLES 10 Linux org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

Avatar of ostraaten
ostraaten asked on
Linux OS DevEditors IDEsLinux Distributions
9 Comments1 Solution7824 ViewsLast Modified:
Hi,
I'm trying to run Eclipse Process Framework headless on SLES 10 Linux. This fails with a message Exception in thread "Thread-2" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

So what I'm doing is the following: I ssh to my SLES 10 machine and then run a java command java -jar /home/user/epfc_1.5.0.2/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar -data /home/user/epfc_workspace -nosplash -application org.eclipse.epf.publishing.cmdline.Publish -libraryPath /home/user/tmp/epfprac/org.eclipse.epf/libraries/EPF_Practices/ -publishPath /home/usertmp/epfprac_publish -config publish.all_epf_practices -os linux -arch x86 -ws gtk

This causes the following error.
Exception in thread "Thread-2" org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
      at org.eclipse.swt.SWT.error(SWT.java:3589)
      at org.eclipse.swt.widgets.Display.createDisplay(Display.java:836)
      at org.eclipse.swt.widgets.Display.create(Display.java:824)
      at org.eclipse.swt.graphics.Device.<init>(Device.java:152)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:472)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:463)
      at org.eclipse.epf.publishing.cmdline.Publish$1.run(Publish.java:77)
      at java.lang.Thread.run(Unknown Source)
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
      at org.eclipse.swt.SWT.error(SWT.java:3589)
      at org.eclipse.swt.widgets.Display.createDisplay(Display.java:836)
      at org.eclipse.swt.widgets.Display.create(Display.java:824)
      at org.eclipse.swt.graphics.Device.<init>(Device.java:152)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:472)
      at org.eclipse.swt.widgets.Display.<init>(Display.java:463)
      at org.eclipse.swt.widgets.Display.getDefault(Display.java:1604)
      at org.eclipse.epf.library.services.SafeUpdateController.asyncExec(SafeUpdateController.java:59)
      at org.eclipse.epf.library.LibraryService.notifyListeners(LibraryService.java:659)
      at org.eclipse.epf.library.LibraryService.setCurrentMethodLibrary(LibraryService.java:455)
      at org.eclipse.epf.library.LibraryService.openMethodLibrary(LibraryService.java:230)
      at org.eclipse.epf.publishing.cmdline.Publish.run(Publish.java:105)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:572)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:171)
      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(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Internal Error

I found some info about this error https://bugs.eclipse.org/bugs/show_bug.cgi?id=106396
"Usually, if gtk_init_check() is failing, it means the DISPLAY environment
variable is not pointing at a running X server.  I would first advise you to
make absolutely sure that when you're running the tests on the command
line that the environment variables are being passed down correctly
to the command that actually runs the tests."

Before I run the Java command, it is true that DISPLAY is not set. But as I understand, but I'm not sure, Eclipse takes care, or better should take care of setting a display. For this purpose the -ws gtk switch is passed on the command line.

I suspect that it is failing to start a ws in memory. So maybe gtk is not properly installed or working but I don't know how to test this.

I tried all kinds of things and I'm getting some clues but it didn't fix the problem

For example I run

ssh -X user@myserver

Now I have a display set and when I run the java command more is happening. For instance I see a lot of
(SWT:22063): Gdk-WARNING **: Error converting from UTF-8 to STRING: Conversion from character set 'UTF-8' to 'ISO-8859-1' is not supported

And then the process ends again with a error message
org.eclipse.swt.SWTError: Not implemented [multiple displays]

So this error could imply that now I have a display set and that Eclipse is trying to set another one, and a different one (gtk?).

Any ideas on why this is not working. Any ideas on how I can run Eclipse headless under SLES Linux?

Thanks and Regards,
Onno

ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmannFlag of Germany image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answers