【问题标题】:Getting error when using functions in pentaho kettle在 pentaho 水壶中使用函数时出错
【发布时间】:2013-10-12 13:20:54
【问题描述】:

我在 kettle 的转换中添加一个公式。在该公式的属性中,当我单击公式文本字段时,出现错误:

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

请帮我解决一下

【问题讨论】:

    标签: pentaho kettle


    【解决方案1】:

    有几个问题可能会阻止此功能正常工作。 根本原因是 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 运行程序 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

    【讨论】:

      【解决方案2】:

      您还可以通过替换 Kettle 的 libswt 文件夹中的 SWT jar 和 SWT-GTK jar 来解决此问题。

      Diethard Steiner 在他的博客中描述了使用 Eclipse 中的 JAR 文件的简单过程:

      http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html

      这样你就不用搞乱启动脚本了;但请记住,更改也会被更新覆盖。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多