Pentaho Maven依赖

时间:2015-09-23 23:55:09

标签: java maven pom.xml pentaho

我最近更新了一个与scala一起工作的项目,并决定使用从Pentaho 5.4到Maven的Kettle来移动我的依赖项,包括ETL进程。但是,当我使用javascript运行转换时,我不断收到错误,告诉我函数不存在。我的具体错误如下。如何使用Maven使我的转换适当地运行JS?

Pentaho的当前POM依赖关系

       <dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-core</artifactId>
          <version>5.4.0.4-149</version>
        </dependency>
         <dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-db</artifactId>
          <version>4.4.3.5-C183</version>
        </dependency>
        <dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-ui-swt</artifactId>
          <version>5.4.0.4-149</version>
        </dependency>
        <dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-engine</artifactId>
          <version>5.4.0.4-149</version>
        </dependency>
         <dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-dbdialog</artifactId>
          <version>5.4.0.4-149</version>
        </dependency>
        <dependency>
          <groupId>pentaho-library</groupId>
          <artifactId>libformula</artifactId>
          <version>5.4.0.1-130</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.4-1202-jdbc42</version>
        </dependency>
        <dependency>
            <groupId>pentaho-library</groupId>
            <artifactId>libformula</artifactId>
            <version>5.4.0.1-130</version>
        </dependency>
        <dependency>
            <groupId>rhino</groupId>
            <artifactId>js</artifactId>
            <version>1.7R3</version>
       </dependency>
       <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <version>2.5.16</version>
       </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-vfs2</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>javax.mail-api</artifactId>
            <version>1.5.4</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.12</version>
       </dependency>

错误

[main] INFO com.hygenics.parser.MainApp - Beginning Kettle Transformation @ Wed Sep 23 17:44:52 MDT 2015
[main] INFO com.hygenics.parser.MainApp - Starting ktr PATH: /home/aevans/scrape/Pentaho/CACRIMCIVIL/Yolo/us_ca_yolo_aoc_clean_recors.ktr @ Wed Sep 23 17:44:59 MDT 2015
2015/09/23 17:45:05 - us_ca_yolo_aoc_clean_recors - Dispatching started for transformation [us_ca_yolo_aoc_clean_recors]
2015/09/23 17:45:08 - Table output 2.0 - Connected to database [scrape_production] (commit=1000)
2015/09/23 17:45:08 - Table output 3.0 - Connected to database [scrape_production] (commit=1000)
2015/09/23 17:45:08 - Table output.0 - Connected to database [scrape_production] (commit=1000)
2015/09/23 17:45:08 - Table output 4.0 - Connected to database [scrape_production] (commit=1000)
2015/09/23 17:45:11 - Table input.0 - Finished reading query, closing connection.
2015/09/23 17:45:12 - dt.0 - Finished processing (I=0, O=0, R=4729, W=4729, U=0, E=0)
2015/09/23 17:45:12 - Table input.0 - Finished processing (I=4729, O=0, R=0, W=4729, U=0, E=0)
2015/09/23 17:45:12 - Replace in string.0 - Finished processing (I=0, O=0, R=4729, W=4729, U=0, E=0)
2015/09/23 17:45:12 - Filter rows.0 - Finished processing (I=0, O=0, R=4729, W=4729, U=0, E=0)
2015/09/23 17:45:12 - String operations.0 - Finished processing (I=0, O=0, R=4729, W=4729, U=0, E=0)
java.lang.NoSuchMethodError: org.mozilla.javascript.ContextFactory.enterContext()Lorg/mozilla/javascript/Context;
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:178)
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:540)
    at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
    at java.lang.Thread.run(Thread.java:745)
2015/09/23 17:45:12 - dno.0 - ERROR (version 5.4.0.4-149, build 1 from 2015-09-17 09.58.29 by buildguy) : Unexpected error
2015/09/23 17:45:12 - dno.0 - ERROR (version 5.4.0.4-149, build 1 from 2015-09-17 09.58.29 by buildguy) : java.lang.NoSuchMethodError: org.mozilla.javascript.ContextFactory.enterContext()Lorg/mozilla/javascript/Context;
2015/09/23 17:45:12 - dno.0 -   at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:178)
2015/09/23 17:45:12 - dno.0 -   at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:540)
2015/09/23 17:45:12 - dno.0 -   at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2015/09/23 17:45:12 - dno.0 -   at java.lang.Thread.run(Thread.java:745)
child index = 6, logging object : org.pentaho.di.core.logging.LoggingObject@46e1bfda parent=f052f9e5-896e-4fdd-9a6a-12f3b3334ed3
2015/09/23 17:45:12 - dno.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
2015/09/23 17:45:12 - us_ca_yolo_aoc_clean_recors - Transformation detected one or more steps with errors.
2015/09/23 17:45:12 - us_ca_yolo_aoc_clean_recors - Transformation is killing the other steps!
2015/09/23 17:45:13 - us_ca_yolo_aoc_clean_recors - ERROR (version 5.4.0.4-149, build 1 from 2015-09-17 09.58.29 by buildguy) : Errors detected!
[main] INFO com.hygenics.parser.MainApp - ERROR IN PENTAHO
2015/09/23 17:45:13 - us_ca_yolo_aoc_clean_recors - ERROR (version 5.4.0.4-149, build 1 from 2015-09-17 09.58.29 by buildguy) : Errors detected!
[main] INFO com.hygenics.parser.MainApp - Transformation Returned: 1 @Wed Sep 23 17:45:13 MDT 2015
[main] INFO com.hygenics.parser.MainApp - Kettle Complete: Cleaning Up
[main] INFO com.hygenics.parser.MainApp - Transformation Complete @ Wed Sep 23 17:45:14 MDT 2015
[main] INFO com.hygenics.parser.MainApp - Ending Kettle Transformation @ Wed Sep 23 17:45:14 MDT 2015
[main] INFO com.hygenics.parser.MainApp - Free Memory: 117241936
[main] INFO com.hygenics.parser.MainApp - Completed Parse @ Wed Sep 23 17:45:14 MDT 2015

1 个答案:

答案 0 :(得分:4)

由于我不喜欢回答我自己的问题,我只是要把它取下来,但这比我自己一直是一个问题,并且实际上出现在没有解决方案的Pentaho票务系统中。答案是删除通过Kettle-core依赖项下载的某个jar。显然,Batik-js会引发问题。

<dependency>
          <groupId>pentaho-kettle</groupId>
          <artifactId>kettle-core</artifactId>
          <version>5.4.0.4-149</version>
          <exclusions>
            <exclusion>
                    <groupId>org.apache.xmlgraphics</groupId>
                    <artifactId>batik-js</artifactId>
            </exclusion>
          </exclusions>
        </dependency>