SWTError: No more handles [gtk_init_check() failed] running platform tests (on Linux)
2015-04-23 11:46
531 查看
http://www.lemmster.de/2013-12-19-swterror-no-more-handles-gtk_init_check-failed-running-platform-tests-on-linux.html
When running platform tests on Linux (and Mac?) one might encounter the following exception:
The underlying cause isn't found in SWT though, but in the .launch configuration's environment setting. In order to run the tests on a dedicated DISPLAY to avoid interferences, tests set the DISPLAY env var explicitly. Thus, an X instance has to be made available. This is easily done by installing Xvfb the X virtual frame buffer (e.g. "sudo apt-get install xvfb") and starting it on 1:0 with "Xvfb :1 &". Voilà, this magically increases the number of handles. ;-)
![](http://www.lemmster.de/uploads/EnvironmentTabEclipseWithDisplay-300x256.png)
SWTError: No more handles [gtk_init_check() failed] running platform tests (on Linux)
Thu 19 December 2013by Markus A. Kuppein eclipseWhen running platform tests on Linux (and Mac?) one might encounter the following exception:
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] at org.eclipse.swt.SWT.error(SWT.java:4445) at org.eclipse.swt.widgets.Display.createDisplay(Display.java:929) at org.eclipse.swt.widgets.Display.create(Display.java:913) at org.eclipse.swt.graphics.Device.<init>(Device.java:157) at org.eclipse.swt.widgets.Display.<init>(Display.java:509) at org.eclipse.swt.widgets.Display.<init>(Display.java:500) at org.eclipse.swt.widgets.Display.getDefault(Display.java:1719) at org.eclipse.e4.ui.tests.workbench.InjectionThreadDomainTest.setUp(InjectionThreadDomainTest.java:84) at junit.framework.TestCase.runBare(TestCase.java:139) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:129) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at junit.framework.TestSuite.runTest(TestSuite.java:255) at junit.framework.TestSuite.run(TestSuite.java:250) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:131) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
The underlying cause isn't found in SWT though, but in the .launch configuration's environment setting. In order to run the tests on a dedicated DISPLAY to avoid interferences, tests set the DISPLAY env var explicitly. Thus, an X instance has to be made available. This is easily done by installing Xvfb the X virtual frame buffer (e.g. "sudo apt-get install xvfb") and starting it on 1:0 with "Xvfb :1 &". Voilà, this magically increases the number of handles. ;-)
![](http://www.lemmster.de/uploads/EnvironmentTabEclipseWithDisplay-300x256.png)
相关文章推荐
- Centos7安装Eclipse报错: Could not load SWT library以及No more handles [gtk_init_check() failed]
- Valgrind:failed to start tool 'memcheck' for platform 'x86-linux': No such file or directory
- valgrind提示 failed to start tool 'memcheck' for platform 'x86-linux'
- 【排错】Failed to replace a bad datanode on the existing pipeline due to no more good ...
- hadoop错误java.io.IOException Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being available to try
- linux 启动错误:INIT:no more processes left in this runlevel
- Failed to execute /linuxrc;Kernel panic - not syncing: No init found
- SFCS Running on Linux Platform
- Oracle Impdp Failed on RAC with ORA-31640, ORA-19505, ORA-27037, Linux-x86_64 Error: 2: No such file
- “Failed to load platform plugin ”xcb“ ” while launching qt5 app on linux without qt installed
- java.io.IOException: Failed to replace a bad datanode on the existing pipeline due to no more good
- hadoop错误java.io.IOException Failed to replace a bad datanode on the existing pipeline due to no more
- ORA-09817: Write to audit file failed Linux-x86_64 Error: 28: No space left on device
- 用Sleak工具来检测句柄泄漏 SWTError: No more handles 终极解决!
- Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being availa
- linux在虚拟机中Determining IP Information for eth0...failed; no link present. Check cable?"问题解决方案
- eclipse no more handles )
- Upon startup of Linux database get ORA-27102: out of memory Linux-X86_64 Error: 28: No space left on device
- myeclipse启动错误:org.eclipse.swt.SWTError: No more handles
- Unhandled event loop exception No more handles