背景
Wins 环境下运行正常,将同一份转换文件上传至Linux 运行报错。
1、kettle 客户端运行界面
2、Wins 环境下cmd 命令行运行正常
cmd 命令行下运行代码:
d:
cd D:\tools\pdi-ce-9.1.0.0-324\data-integration
D:\tools\pdi-ce-9.1.0.0-324\data-integration>pan.bat /file:D:\tools\pdi-ce-9.1.0.0-324\data-integration\samples\jobs\insert_103_table_output.ktr /level:Basic > D:\tools\pdi-ce-9.1.0.0-324\data-integration\logs\insert_103_table_output_01.log
3、Linux 环境下运行报错
报错信息如下:
2023/05/24 12:03:56 - source_query.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Error initializing step [source_query]
2023/05/24 12:03:56 - insert_data.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Error initializing step [insert_data]
2023/05/24 12:03:56 - insert_data.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : java.lang.NoClassDefFoundError: Could not initialize class oracle.dms.instrument.Noun
2023/05/24 12:03:56 - insert_data.0 - at oracle.dms.instrument.NounFactory.getRoot(NounFactory.java:139)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.DMSFactory.getRoot(DMSFactory.java:97)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.DMSFactory.createNoun(DMSFactory.java:68)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:1769)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:873)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:525)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:76)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:829)
2023/05/24 12:03:56 - insert_data.0 - at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:633)
2023/05/24 12:03:56 - insert_data.0 - at java.sql.DriverManager.getConnection(DriverManager.java:664)
2023/05/24 12:03:56 - insert_data.0 - at java.sql.DriverManager.getConnection(DriverManager.java:208)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:598)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.core.database.Database.normalConnect(Database.java:477)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.core.database.Database.connect(Database.java:389)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.core.database.Database.connect(Database.java:360)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.init(TableOutput.java:533)
2023/05/24 12:03:56 - insert_data.0 - at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:69)
2023/05/24 12:03:56 - insert_data.0 - at java.lang.Thread.run(Thread.java:748)
2023/05/24 12:03:56 - source_query.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : java.lang.NoClassDefFoundError: oracle/core/ojdl/MessageType
2023/05/24 12:03:56 - source_query.0 - at oracle.dms.instrument.Level.initLevel(Level.java:226)
2023/05/24 12:03:56 - source_query.0 - at oracle.dms.instrument.LogLevel.initLogLevel(LogLevel.java:41)
2023/05/24 12:03:56 - source_query.0 - at oracle.dms.instrument.LogLevel.<clinit>(LogLevel.java:22)
2023/05/24 12:03:56 - source_query.0 - at oracle.dms.instrument.Noun.<clinit>(Noun.java:2176)
2023/05/24 12:03:56 - source_query.0 - at oracle.dms.instrument.NounFactory.getRoot(NounFactory.java:139)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.DMSFactory.getRoot(DMSFactory.java:97)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.DMSFactory.createNoun(DMSFactory.java:68)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:1769)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:873)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:525)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:76)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:829)
2023/05/24 12:03:56 - source_query.0 - at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:633)
2023/05/24 12:03:56 - source_query.0 - at java.sql.DriverManager.getConnection(DriverManager.java:664)
2023/05/24 12:03:56 - source_query.0 - at java.sql.DriverManager.getConnection(DriverManager.java:208)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:598)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.core.database.Database.normalConnect(Database.java:477)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.core.database.Database.connect(Database.java:389)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.core.database.Database.connect(Database.java:360)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.trans.steps.tableinput.TableInput.init(TableInput.java:343)
2023/05/24 12:03:56 - source_query.0 - at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:69)
2023/05/24 12:03:56 - source_query.0 - at java.lang.Thread.run(Thread.java:748)
2023/05/24 12:03:56 - source_query.0 - Caused by: java.lang.ClassNotFoundException: oracle.core.ojdl.MessageType
2023/05/24 12:03:56 - source_query.0 - at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
2023/05/24 12:03:56 - source_query.0 - at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
2023/05/24 12:03:56 - source_query.0 - at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
2023/05/24 12:03:56 - source_query.0 - ... 22 more
2023/05/24 12:03:56 - insert_103_table_output - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Step [source_query.0] failed to initialize!
2023/05/24 12:03:56 - insert_103_table_output - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Step [insert_data.0] failed to initialize!
运行代码,与WINS 环境类似,略有不同:
[root@localhost data-integration]$ ./pan.sh -file=./scripts/insert_103_table_output.ktr -level=Basic >> ./logs/insert_103_table_output_8.log
看日志信息,应该是跟Jar 包有关系,心想自己也是参考安装文档上安装的,将JDBC jar 都解压并放进了 kettle 目录下的data-integration\lib 文件夹下,网上找了好一通,没有找到解决方案。后来发现可能是Jar 包冲突了,就开始逐一删除data-integration\lib 文件下自己新增的Jar 包,发现删除
ojdbc8dms_g.jar
和
ojdbc8dms.jar
这两个Jar 包时,运行正常。
版权声明:本文为sinat_39619040原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。