我需要从pentaho ETL运行一个jar文件。我已将我的Testvmarguments.jar文件放在
中服务器/数据集成服务器/ Tomcat的/ lib中
。创建作业,使用shell脚本步骤执行jar文件
以下是我的日志: -
INFO 02-01 17:05:59,002 - ImageImporter - Start of job execution
INFO 02-01 17:05:59,007 - ImageImporter - Starting entry [Shell]
INFO 02-01 17:05:59,008 - Shell - Running on platform : Linux
INFO 02-01 17:05:59,008 - Shell - Executing command : /home/Myname/MyFolder/dummy.txt
INFO 02-01 17:05:59,014 - Shell - (stderr) Unable to access jarfile Testvmarguments.jar INFO 02-01 17:05:59,015 - ImageImporter - Finished job entry [Shell] (result=[false])
INFO 02-01 17:05:59,015 - ImageImporter - Job execution finished
INFO 02-01 17:05:59,017 - Kitchen - Finished! ERROR 02-01 17:05:59,017 - Kitchen - Finished with errors
INFO 02-01 17:05:59,017 - Kitchen - Start=2014/01/02 17:05:56.504, Stop=2014/01/02 17:05:59.017
INFO 02-01 17:05:59,017 - Kitchen - Processing ended after 2 seconds.
有人可以帮助克服上述错误。
DI环境中的jar文件.. !!!
请在link
找到附件我使用shell脚本的原因是执行带有运行时参数的jar。
java -Dfilepath = / home / Myfolder / Myname / Test -Dname = Myname -jar Testvmarguments.jar
这是我的一段代码
package com.alliance.test;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
public class TestCommandLine
{
public static void main(String[] args)
throws Exception
{
String filename = null;
String employeeName = null;
if (System.getProperty("filepath") != null) {
filename = System.getProperty("filepath");
}
if (System.getProperty("name") != null) {
employeeName = System.getProperty("name");
}
File file = new File(filename + "Test.txt");
if (!file.exists())
file.createNewFile();
FileWriter fw = new FileWriter(file);
BufferedWriter out = new BufferedWriter(fw);
out.write(filename + "\n");
out.write(employeeName);
out.close();
fw.close();
}
}
谢谢, 苏里亚
答案 0 :(得分:2)
不要将其称为外部进程,因为您不必启动新的vm。而只是将jar添加到lib文件夹并从javascript步骤或udjc中调用它
答案 1 :(得分:0)
将jar放入数据集成的目录文件夹(server / data-integration-server / tomcat)后尝试
答案 2 :(得分:0)
我将jar复制到libext文件夹。 在JS步骤中使用以下语句
var testval2 = org.wtc.pentaho.PentahoSample.testSample(“surya”);