I need to run a jar file from pentaho ETL . I have placed my Testvmarguments.jar file in
server/data-integration-server/tomcat/lib
. Created job,with shell script step to execute the jar file
Below is my log:-
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.
Can some one help to overcome above error .
jar file in DI environment..!!!
Please find the attachment at link
I reason for using shell script is to execute a jar with runtime parameters .
java -Dfilepath=/home/Myfolder/Myname/Test -Dname=Myname -jar Testvmarguments.jar
Here is my piece of code
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();
}
}
Thanks, Surya
I copied jar to libext folder. used following statement in JS step
var testval2 = org.wtc.pentaho.PentahoSample.testSample("surya");