首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到ID Kettle

找不到ID Kettle
EN

Stack Overflow用户
提问于 2022-09-30 21:17:37
回答 1查看 160关注 0票数 0

我试图在Java中集成Kettle并执行一个转换。这些软件包被正确下载。但是,当我试图以Java应用程序的形式运行转换时,我会收到以下异常:

代码语言:javascript
复制
Unable to find plugin with ID 'Kettle'.  If this is a test, make sure kettle-core tests jar is a dependency.  If this is live make sure a kettle-password-encoder-plugins.xml exits in the classpath

    at org.pentaho.di.core.encryption.Encr.init(Encr.java:61)
    at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:124)
    at org.pentaho.di.core.KettleClientEnvironment.init(KettleClientEnvironment.java:80)
    at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:134)
    at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:101)
    at org.pentaho.di.core.KettleEnvironment.init(KettleEnvironment.java:82)
    at com.marc.TFG.test.pentaho.EjecutarTransformaciones.main(EjecutarTransformaciones.java:13)

文件:EjecutarTransformaciones.java

代码语言:javascript
复制
package com.marc.TFG.test.pentaho;

import org.pentaho.di.core.KettleEnvironment;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.logging.LogLevel;
import org.pentaho.di.trans.Trans;
import org.pentaho.di.trans.TransMeta;

public class EjecutarTransformaciones {

    public static void main(String[] args) throws KettleException {

        KettleEnvironment.init();
        TransMeta transMeta = new TransMeta("D:\\PROYECTO_TFG\\KJB\\Prueba.ktr");
        Trans trans = new Trans(transMeta);
        trans.setLogLevel(LogLevel.BASIC);
        trans.execute(null);
        trans.waitUntilFinished();

        if(trans.getErrors() > 0){
            System.out.println("Han habido errores");
        }

    }
}

pom.xml

代码语言:javascript
复制
       <repositories>
          <repository>
              <id>pentaho-releases</id>
              <url>https://nexus.pentaho.org/content/groups/omni</url>
          </repository>
       </repositories>
        <!-- PENTAHO KETTLE DEPENDENCIES -->
        <dependency>
            <groupId>pentaho-kettle</groupId>
            <artifactId>kettle-core</artifactId>
            <version>9.1.0.0-324</version>
        </dependency>
        
        <dependency>
            <groupId>pentaho-kettle</groupId>
            <artifactId>kettle-engine</artifactId>
            <version>9.1.0.0-324</version>
        </dependency>

        <dependency>
            <groupId>pentaho-kettle</groupId>
            <artifactId>kettle-ui-swt</artifactId>
            <version>9.1.0.0-324</version>
            <scope>provided</scope>
        </dependency>
        
         <dependency>
            <groupId>pentaho-library</groupId>
            <artifactId>libformula</artifactId>
            <version>7.0.0.6-95</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging-api</artifactId>
                </exclusion>
            </exclusions>   
        </dependency>
                
        <dependency>
            <groupId>pentaho-kettle</groupId>
            <artifactId>kettle5-log4j-plugin</artifactId>
            <version>7.1.0.31-241</version>
        </dependency>

我正在运行Java 8,希望有一个简单的解决方案

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-05 09:50:15

经过几天的调查,我终于找到了一个解决办法

我添加了一个新的Source文件夹,其中包含‘kettle-password-编码器-plugins.xml’文件。

UPDATE:您可以轻松地删除资源上的文件,因此它包含在类路径中。

即:

代码语言:javascript
复制
<password-encoder-plugins>
  <password-encoder-plugin id="Kettle">
    <description>Kettle Password Encoder</description>
    <classname>org.pentaho.support.encryption.KettleTwoWayPasswordEncoder</classname>
  </password-encoder-plugin>
</password-encoder-plugins>

而且看起来挺好的。

在项目中为这个文件创建一个文件夹,然后在IDE (在我的例子中是Eclipse)中,您应该可以看到在中创建的文件夹。然后右击->生成路径->用作源文件夹

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73914032

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档