Eclipse UI测试在Redhat Jenkins服务器上使用gtk_init_check()失败
当通过Jenkins在Redhat服务器(6.7)上对Eclipse运行Tycho UI测试时,发生下面的异常。我知道一个图形子系统必须安装并运行,但是我的设置似乎有些不妥。我已经通过“yum groupinstall Desktop”安装了GTK。Eclipse UI测试在Redhat Jenkins服务器上使用gtk_init_check()失败
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)
richardb
回答
虚拟桌面必须运行。对此可以使用Xvfb,如http://www-01.ibm.com/support/docview.wss?uid=swg21421214所述。在Redhat上可以使用:
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应该可通过添加一个shell脚本来/etc/profile.d/在其中包含唯一的行:
export DISPLAY=:5
试验期间在我设置的默认运行级别5/etc/inittab中/但我没有进一步研究这是否是绝对必要的。
richardb
相关文章
- 云上的米开朗基罗:在不确定时代,寻找建筑般的确定性
- django框架之drf(部分讲解)
- 【算法训练营day31】LeetCode455. 分发饼干 LeetCode376. 摆动序列 LeetCode53. 最大子序和
- 2023考研资料整合推荐
- Docker数据管理
- 安畅网络云管理服务
- Asp.Net7 与 Vue3 组成的 BFF模式
- 《安富莱嵌入式周报》第301期:ThreadX老大离开微软推出PX5 RTOS第5代系统,支持回流焊的自焊接PCB板设计,单色屏实现多级灰度播放视频效果
- Python Numpy 中的打印设置函数set_printoptions
- 真实感渲染:模型变换
- [概率论与数理统计]笔记:5.2 参数的最大似然估计与矩估计
- 装饰模式
- [概率论与数理统计]笔记:5.1 点估计概述
- Blazor模式讲解
- [概率论与数理统计]笔记:4.4 抽样分布
- C++11简易线程池实现
- Codeforces Round #847 (Div. 3) ABCDE
- 《云管理服务白皮书》总结
- 【算法训练营day29】LeetCode491. 递增子序列 LeetCode46. 全排列 LeetCode47. 全排列II
- 电脑配置