Java Pentaho Exception MongoDB

痴心易碎 提交于 2020-01-26 00:17:47

问题


I have designed a transformation in Pentaho Data Integration ui tool and wrote a java code to execute the transformation. I followed below resources link as it is,

try {
      /**
       * Initialize the Kettle Enviornment
       */
      KettleEnvironment.init();

      /**
       * Create a trans object to properly assign the ktr metadata.
       * 
       * @filedb: The ktr file path to be executed.
       * 
       */
      TransMeta metadata = new TransMeta("Districts.ktr");
      Trans trans = new Trans(metadata);

      // Execute the transformation
      trans.execute(null);
      trans.waitUntilFinished();

      // checking for errors
      if (trans.getErrors() > 0) {
          System.out.println("Erroruting Transformation");
      }

  } catch (KettleException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }  

my POM.xml is below

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.test.kettle</groupId>
<artifactId>kettle-run</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
    <pentaho-kettle.version>5.0.0.1</pentaho-kettle.version>
    <postgres.version>9.2-1004-jdbc41</postgres.version>
</properties>

<repositories>
    <repository>
        <id>pentaho-releases</id>
        <url>http://repository.pentaho.org/artifactory/repo/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>pentaho-kettle</groupId>
        <artifactId>kettle-core</artifactId>
        <version>${pentaho-kettle.version}</version>
    </dependency>
    <dependency>
        <groupId>pentaho-kettle</groupId>
        <artifactId>kettle-dbdialog</artifactId>
        <version>${pentaho-kettle.version}</version>
    </dependency>
    <dependency>
        <groupId>commons-vfs</groupId>
        <artifactId>commons-vfs</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>pentaho-kettle</groupId>
        <artifactId>kettle-engine</artifactId>
        <version>${pentaho-kettle.version}</version>
    </dependency>
    <dependency>
        <groupId>pentaho-kettle</groupId>
        <artifactId>kettle-ui-swt</artifactId>
        <version>${pentaho-kettle.version}</version>
    </dependency>
    <dependency>
        <groupId>pentaho-library</groupId>
        <artifactId>libformula</artifactId>
        <version>5.0.2</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.codehaus.janino</groupId>
        <artifactId>janino</artifactId>
        <version>2.5.16</version>
    </dependency>
    <dependency>
        <groupId>org.mozilla</groupId>
        <artifactId>rhino</artifactId>
        <version>1.7R5</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>javax.mail-api</artifactId>
        <version>1.4.7</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.4</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
    </dependency>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>${postgres.version}</version>
    </dependency>
    <dependency>
        <groupId>pentaho</groupId>
        <artifactId>pentaho-mongodb-plugin</artifactId>
        <version>5.0.4</version>
    </dependency>
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>2.11.1</version>
    </dependency>
</dependencies>

My transformation has Mongo DB input and then insert in to postgresql. With pentaho version 5.0.0.1 it throws following error

org.pentaho.di.core.exception.KettleMissingPluginsException: 

Missing plugins found while loading a transformation

Step : MongoDbInput at org.pentaho.di.trans.TransMeta.loadXML(TransMeta.java:2931) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2813) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2774) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2759) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2744) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2718) at org.pentaho.di.trans.TransMeta.(TransMeta.java:2690) at org.kettle.test.Execute.main(Execute.java:72)

What could be the reason behind this?

Thank you in advance

Thusira


回答1:


Added kettle.properties file the plugin folder location

KETTLE_PLUGIN_BASE_FOLDERS = /Users/dir/kettel/Plugin



来源:https://stackoverflow.com/questions/41676833/java-pentaho-exception-mongodb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!