1
votes

I currently have a transformation that includes a UserDefinedJavaClass step. This runs as expected in Spoon. When I try and run this transformation as part of a web application using the Kettle jars I get the following error:

017/01/20 10:04:56 - Load questionnaires.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Error initializing UserDefinedJavaClass:
2017/01/20 10:04:56 - Load questionnaires.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : org.pentaho.di.core.exception.KettleException: 
2017/01/20 10:04:56 - Load questionnaires.0 - null
2017/01/20 10:04:56 - Load questionnaires.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Error initializing step [Load questionnaires]
2017/01/20 10:04:57 - evalue-di-risk - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Step [Load questionnaires.0] failed to initialize!

Because this works in Spoon, I can only assume I am missing a library. I am already including kettle-core, kettle-engine (kettle version 6.1.0.1-196) and janino which I would have thought was all I required to get this running.

EDIT I have taken every jar from the Spoon lib folder and dumped it into my webapp and this didn't work either.

EDIT AGAIN It turns out that the problem is having a UserDefinedJavaClass and a Table Input that contains variables which should be replaced during the transformation does not work and causes the above error.

1
Just note: I had similar issue while running transformations inside reports: if default values of connection parameters do not result in a valid connection, then udjc step fails. Looks like the udjc step gets validated or compiled with default parameter values first, then, if connection is successful, the actual parameter values are inserted. I have ended up with re-writing my logic from java to javascript. But if you are invoking transformation from other java code you could try to change default pdi workflow, e.g. manually set default parameter values before transformation is initialized.Andrei Luksha
I may have to do this too. It is a valid connection and the variables are in my SQL statement.Ben Thomas

1 Answers

0
votes

you can not do that, you have to use the sdk api

and compile from your application.

http://wiki.pentaho.com/display/EAI/The+PDI+SDK