我在水壶的转化中添加了一个公式。在该公式的属性中,当我单击公式文本字段时,我收到错误:
org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME=''] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source)
at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
at org.pentaho.libformula.ui.editor.LibFormulaEditor.<init>(LibFormulaEditor.java:198)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog$3.widgetSelected(FormulaDialog.java:219)
at org.pentaho.di.ui.core.widget.TableView.editText(TableView.java:1940)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1895)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1867)
at org.pentaho.di.ui.core.widget.TableView.editSelected(TableView.java:1326)
at org.pentaho.di.ui.core.widget.TableView.access$3000(TableView.java:107)
at org.pentaho.di.ui.core.widget.TableView$26.mouseDown(TableView.java:949)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog.open(FormulaDialog.java:282)
at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:136)
at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:7835)
at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:2749)
at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:705)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1221)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7044)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:8304)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:580)
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.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
... 35 more
当我查看/home/ron/.swt/lib/linux/
时,它的文件为libswt-mozilla-gtk-3740.so
请帮助我解决方案
答案 0 :(得分:5)
有几个问题可能阻止此功能起作用。 根本原因是Pentaho使用SWT功能,需要在操作系统中安装两个浏览器之一。请参阅此常见问题解答(http://www.eclipse.org/swt/faq.php#browserlinux)。 在我的情况下,我们必须通过向java命令行添加VM选项来选择是否要使用WebKitGTK(webkit)或Mozilla Firefox(mozilla):
-Dorg.eclipse.swt.browser.DefaultType=mozilla
在我的系统Ubuntu 14.04中,webkit浏览器在libsoup中导致错误,因此我需要将其设置为mozilla。有关参考资料,请参阅https://bugs.launchpad.net/ubuntu-gnome/+bug/1163501了解Eclipse中的libsoup错误,该错误也使用SWT,类似于Pentaho。
然后,我们需要mozilla firefox存在于系统中,还需要mozilla XUL运行库。首先安装firefox:
apt-get install firefox
安装XUL runner 1.9.2因为2.0.0或更高版本被认为是不兼容的(参见http://jira.pentaho.com/browse/PDI-8730)。
wget http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/03/2012-03-02-03-32-11-mozilla-1.9.2/xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
tar -xjf xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
mv xulrunner /opt/xulrunner-1.9.2
使用此VM选项配置xulrunner路径:
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2
我们还需要配置LD_LIBRARY_PATH和MOZILLA_FIVE_HOME指向xulrunner:
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
spoon.sh中的最终设置是:
(spoon.sh,关于第13行)
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
(spoon.sh,关于第184行)
if [ -z "$PENTAHO_DI_JAVA_OPTIONS" ]; then
PENTAHO_DI_JAVA_OPTIONS="-Xmx512m -XX:MaxPermSize=256m -Dorg.eclipse.swt.browser.DefaultType=mozilla -Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2"
fi
答案 1 :(得分:0)
您还可以通过替换Kettle的libswt文件夹中的SWT jar和SWT-GTK jar来解决此问题。
Diethard Steiner使用来自Eclipse的JAR文件在他的博客上描述了简单的过程:
http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
这样,您就不必弄乱启动脚本了;但请记住,更改也会被更新覆盖。