昨天需要在一个linux环境上启动kettle,来做些测试,于是先检查了下服务器上已有的gtk版本:
yum list|grep gtk
发现只有gtk2,于是只好安装这个版本:
yum install gtk2.x86_64
yum install gtk2-devel.x86_64

启动环境为linux的centos6.8,cpu架构为x86_64.

第一次启动,运气非常差,报如下错误:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
   no swt-pi-gtk-3659 in java.library.path
   no swt-pi-gtk in java.library.path
   /tmp/swtlib-64/libswt-pi-gtk-3659.so: libXtst.so.6: cannot open shared object file: No such file or directory
   Can't load library: /tmp/swtlib-64/libswt-pi-gtk.so

   at org.eclipse.swt.internal.Library.loadLibrary(Library.java:267)
   at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
   at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
   at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
   at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
   at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
   at org.eclipse.swt.widgets.Widget.isValidSubclass(Widget.java:988)
   at org.eclipse.swt.widgets.Decorations.checkSubclass(Decorations.java:164)
   at org.eclipse.swt.widgets.Shell.<init>(Shell.java:258)
   at org.eclipse.swt.widgets.Shell.<init>(Shell.java:253)
   at org.eclipse.swt.widgets.Shell.<init>(Shell.java:204)
   at org.eclipse.swt.widgets.Shell.<init>(Shell.java:140)
   at com.dameng.common.gui.util.SWTUtility.canInitGUI(SWTUtility.java:380)
   at com.dameng.install.ui.MainApplication.run(MainApplication.java:82)
   at com.dameng.install.ui.MainApplication.main(MainApplication.java:430)

具体的错误我忘了拍照,我在网上找了上面的代码,并照着映像修改了一下。
我搜索了一下,然后找到如下的解决方案:
#yum install libXp
#yum install libXt
#yum install libxtst
来源:https://blog.csdn.net/maoxiang/article/details/5747109

但是实际操作时,头两步执行成功了,最后一步需要修改一下:
yum install libXtst.x86_64

然后使用xshell再次执行启动命令,又报错:

No more handles [gtk_init_check() failed]

先检查xmanager组件有没有安装完全,手动启动xmanager-passive
然后检查xshell会话属性:SSH-隧道页面,
勾选:转发11连接到(x)以及xmanager

在这里插入图片描述
然后执行安装x窗口系统:

yum groupinstall "X Window System" -y

然后重连ssh,执行启动kettle的命令
这次终于可以看到远程界面了,但是非常遗憾的是,启动过程中jvm崩溃了,崩溃日志部分如下:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000000000, pid=25525, tid=0x00007f77cb94a700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_191-b12) (build 1.8.0_191-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.191-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [ld-linux-x86-64.so.2+0xe1dc]
#
# Core dump written. Default location: /opt/etldesigner/common/core or core.25525 (max size 65535 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting
 Java again#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
......
Stack: [0x00007f77cb90a000,0x00007f77cb94b000],  sp=0x00007f77cb948748,  free space=249k
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.mozilla.XPCOM._NS_InitXPCOM2(JJJ)I+0
j  org.eclipse.swt.internal.mozilla.XPCOM.NS_InitXPCOM2(JJJ)I+11
j  org.eclipse.swt.browser.Mozilla.initXPCOM(Ljava/lang/String;Z)V+563
j  org.eclipse.swt.browser.Mozilla.create(Lorg/eclipse/swt/widgets/Composite;I)V+192
j  org.eclipse.swt.browser.Browser.<init>(Lorg/eclipse/swt/widgets/Composite;I)V+81
j  org.pentaho.di.ui.spoon.SpoonBrowser.createBrowser()Lorg/eclipse/swt/browser/Browser;+9
j  org.pentaho.di.ui.spoon.SpoonBrowser.<init>(Lorg/eclipse/swt/widgets/Composite;Lorg/pentaho/di/ui/spoon/Spoon;Ljava/lang/String;ZZLorg/eclipse/swt/browser/LocationListen
er;)V+137j  org.pentaho.di.ui.spoon.delegates.SpoonTabsDelegate.addSpoonBrowser(Ljava/lang/String;Ljava/lang/String;ZLorg/eclipse/swt/browser/LocationListener;Z)Z+47
j  org.pentaho.di.ui.spoon.delegates.SpoonTabsDelegate.addSpoonBrowser(Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/swt/browser/LocationListener;Z)Z+7
j  org.pentaho.di.ui.spoon.Spoon.addSpoonBrowser(Ljava/lang/String;Ljava/lang/String;Lorg/eclipse/swt/browser/LocationListener;)Z+11
j  org.pentaho.di.ui.spoon.Spoon.showWelcomePage()V+102
j  org.pentaho.di.ui.spoon.Spoon.init(Lorg/pentaho/di/trans/TransMeta;)V+805
j  org.pentaho.di.ui.spoon.Spoon.createContents(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+10
j  org.eclipse.jface.window.Window.create()V+14
j  org.eclipse.jface.window.Window.open()I+23
j  org.pentaho.di.ui.spoon.Spoon.start()V+6
j  org.pentaho.di.ui.spoon.Spoon.main([Ljava/lang/String;)V+336
v  ~StubRoutines::call_stub
j  sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0
j  sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100
j  sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+56
j  org.pentaho.commons.launcher.Launcher.main([Ljava/lang/String;)V+453
v  ~StubRoutines::call_stub

这个问题比较棘手,找了公司架构师帮忙调试,同时也一边搜索,还好万能的搜索引擎最终帮我解决了问题,搜索到的贴子如下:
http://www.bubuko.com/infodetail-466886.html
检查了现场环境的xulrunner版本果然是和swt不兼容的版本,于是找到下载的包替换:
https://ftp.mozilla.org/pub/xulrunner/releases/1.9.2.18/sdk/

这次终于启动成功了。

中途以为是swt版本和gtk版本不兼容,于是去swt官网查了一下gtk和swt对应版本的关系,并下了几个版本的swt包来试,最后发现与问题无关:
https://www.eclipse.org/swt/faq.php#gtkstartup

GitHub 加速计划 / li / linux-dash
6
1
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐