zoukankan      html  css  js  c++  java
  • SWTError: No more handles [gtk_init_check() failed] running platform tests (on Linux)

    http://www.lemmster.de/2013-12-19-swterror-no-more-handles-gtk_init_check-failed-running-platform-tests-on-linux.html

    SWTError: No more handles [gtk_init_check() failed] running platform tests (on Linux)

    When 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. ;-)

    Launch config Environment Tab Eclipse with Display

  • 相关阅读:
    Python学习:20.Python网络编程(Socket)
    Python学习:19.Python设计模式-单例模式
    Python学习:18.Python异常处理
    Python学习:17.Python面向对象(四、属性(特性),成员修饰符,类的特殊成员)
    Python学习:16.Python面对对象(三、反射,构造方法,静态字段,静态方法)
    Python学习:15.Python面向对象(二、继承的各种情况)
    Python学习:14.Python面向对象(一)
    Python学习:13.Python正则表达式
    WEB前端解决浏览器兼容性问题
    如何将任意文件固定在 Win10 的开始屏幕中
  • 原文地址:https://www.cnblogs.com/kungfupanda/p/4450023.html
Copyright © 2011-2022 走看看