No more handles [gtk_init_check() failed] [message #4967] |
Fri, 30 May 2008 12:03 |
Eclipse User |
|
|
|
Hi all,
We are trying to get our Eclipse plugin built in a headless fashion, i.e.
from the command-line without the usage of the Eclipse GUI. So far, we`ve
been able to build most of it using PDE build (the Eclipse tooling for
building plugins).
We're using GMF in our project and we do use its code generation feature.
The GMF codegen part depends upon the SWT class (it looks like in the
code, GMF codegen depends on it because it simply tries to get the name of
the SWT class), which requires the SWT OSGi bundle to load. This means
that the whole SWT libraries are trying to initialize for what is just a
code generation process.
On windows it works fine. On linux, it fails with the following output:
[modex.GMFGenerator] org.osgi.framework.BundleException: Exception in
org.eclipse.jdt.internal.ui.JavaPlugin.start() o\
f bundle org.eclipse.jdt.ui.
[modex.GMFGenerator] at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl\
java:1018)
[modex.GMFGenerator] at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:974\
)
[modex.GMFGenerator] at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
[modex.GMFGenerator] at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:260)
[modex.GMFGenerator] at
org.eclipse.osgi.framework.util.SecureAction$21.run(SecureAc tion.java:406)
[modex.GMFGenerator] at
java.security.AccessController.doPrivileged(Native Method)
[modex.GMFGenerator] at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:404)
[modex.GMFGenerator] at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazy\
Starter.java:111)
...
...
[modex.GMFGenerator] Caused by: org.eclipse.swt.SWTError: No more handles
[gtk_init_check() failed]
[modex.GMFGenerator] at org.eclipse.swt.SWT.error(SWT.java:3589)
[modex.GMFGenerator] at
org.eclipse.swt.widgets.Display.createDisplay(Display.java:8 36)
[modex.GMFGenerator] at
org.eclipse.swt.widgets.Display.create(Display.java:824)
[modex.GMFGenerator] at
org.eclipse.swt.graphics.Device.<init>(Device.java:152)
[modex.GMFGenerator] at
org.eclipse.swt.widgets.Display.<init>(Display.java:472)
[modex.GMFGenerator] at
org.eclipse.swt.widgets.Display.<init>(Display.java:463)
[modex.GMFGenerator] at
org.eclipse.swt.widgets.Display.getDefault(Display.java:1604 )
[modex.GMFGenerator] at
org.eclipse.jface.preference.PreferenceConverter.<clinit>(PreferenceConverter.java:80)
[modex.GMFGenerator] at
org.eclipse.jdt.ui.PreferenceConstants.setDefaultAndFireEven t(PreferenceConstants.java:4016\
)
...
...
I found some work around for this specific problem here:
http://www.eclipse.org/tptp/home/downloads/releasenotes/rele asenotes4_3_0.html#4_CTI_4
After reading this release note, I've tried to start a X server before
launching the build:
#!/bin/ksh
# Start the X server on display 33
Xvfb :33 -ac -screen 0 1024x768x8 &
export DISPLAY=:33
# Start a ant task testing the GMF code generation running in an Eclipse
instance java -jar
/pathToEclipseLibs/org.eclipse.equinox.launcher_1.0.1.R33x_v 20070828.jar
-ws gtk -application org.eclipse.ant.core.antRunner -buildfile test.xml
-verbose -debug -consoleLog -clean -data /pathToWorkspace
Starting a X server didn't help though. And now I am stucked here. Do you
see anything wrong or missing from what I described? Did anyone went
through the same issues?
An alternate solution for us would be to pre-generate the GMF generated
code, submit it in our VCS and use it during our build but that is
suboptimal.
Thanks,
Jimmy
|
|
|
Powered by
FUDForum. Page generated in 0.06285 seconds