AnsweredAssumed Answered

Error when executing Json Input through Java

Question asked by Ayan Jana on Aug 8, 2018

Hello Team,

I am trying to run a KTR File through Java as shown in the below code. The KTR calls a REST Service and uses a JSON Input Step to load data into  a RDBMS table. But although the transformation runs fine on Spoon, when I try to execute through Java using below code, I get the error as

 

JSON Input  - Can't run transformation due to plugin missing

Step [JSON Input] failed to initialize!

 

I am using Pentaho Jar version - 7.0.0.6-91. Tried to include the kettle-json-plugin jar but still no luck.

 

Sample Java Code

TransMeta transMeta = new TransMeta(filename, (Repository) null);
// Creating a transformation object which is the programmatic representation of a transformation
// A transformation object can be executed, report success, etc.
Trans transformation = new Trans(transMeta);
// Adjust the log level
transformation.setLogLevel(LogLevel.DETAILED);
System.out.println("\nStarting transformation");

// starting the transformation, which will execute asynchronously
transformation.execute(new String[0]);

// waiting for the transformation to finish
transformation.waitUntilFinished();

Outcomes