2016-08-16 2 views
1

Jenkins를 통해 Redhat 서버 (6.7)에서 Eclipse에 대한 Tycho UI 테스트를 실행하면 예외가 발생합니다. 그래픽 하위 시스템을 설치하고 실행해야한다는 것을 알고 있지만 설정이 잘못되어있는 것으로 보입니다. 이미 "yum groupinstall Desktop"을 통해 GTK를 설치했습니다.Redhat Jenkins 서버에서 gtk_init_check()로 Eclipse UI 테스트가 실패합니다.

org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed] 
    at org.eclipse.swt.SWT.error(SWT.java:4517) 
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:908) 
    at org.eclipse.swt.widgets.Display.create(Display.java:892) 
    at org.eclipse.swt.graphics.Device.<init>(Device.java:156) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:512) 
    at org.eclipse.swt.widgets.Display.<init>(Display.java:503) 
    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:790) 
    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:162) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:169) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:111) 
    at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:31) 
    at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:115) 
    at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:37) 
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) 
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) 
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) 
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515) 
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488) 

답변

2

가상 데스크톱을 실행해야합니다. http://www-01.ibm.com/support/docview.wss?uid=swg21421214에서 설명한대로 Xvfb를 사용할 수 있습니다. 레드햇에서는 다음을 사용할 수 있습니다 :

yum install xorg-x11-server-Xvfb 
Xvfb :5 -screen 0 1280x1024x8 -fbdir /tmp & 
export DISPLAY=:5 

디스플레이 번호는 임의로 선택할 수 있습니다. Jenkins 작업에서 환경 변수도 set-env 플러그인을 통해 설정해야합니다.

모든 작업에이 기능을 사용하려면 여기에 설명 된 스크립트 인 https://superuser.com/questions/319040/proper-way-to-start-xvfb-on-startup-on-centos을 chkconfig로 설정해야합니다. 마지막으로 환경 변수 DISPLAY가 유일한 라인을 포함하는 /etc/profile.d/하는 쉘 스크립트를 추가하여 제공해야합니다 내가 5에 기본 실행 레벨을 설정 실험을하는 동안

export DISPLAY=:5 

을은/etc/inittab에/그러나 나는 이것이 더 엄격하게 필요한지 더 이상의 연구를하지 않았다.

관련 문제