Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Kitchen and Java

  1. #1

    Default Kitchen and Java

    Hello All,
    I have a job that runs perfectly fine when I run it from the command line but If I try to run the same job calling kitchen from a java app. The job fails. I think I know why the job is failing but I don't know how to fix it.

    When I run it through the command prompt, I pass 3 arguments and the jobs runs successfully but when the jobs ir run through the java code, it os not finding the arguments and so I think the job is failing. I am attaching the log file.

    Can anyone tell me how to pass arguments to a job when I am trying to run kitchen through java.

    Thanks
    Shri
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    I believe you can pass the arguments to the "execute" method:

    http://javadoc.pentaho.com/kettle/org/pentaho/di/trans/Trans.html#execute(java.lang.String[])

    Cheers!
    Last edited by tdidomenico; 07-28-2009 at 12:00 PM.

  3. #3

    Default

    Quote Originally Posted by tdidomenico View Post
    I believe you can pass the arguments to the "execute" method:

    http://javadoc.pentaho.com/kettle/org/pentaho/di/trans/Trans.html#execute(java.lang.String[])

    Cheers!

    Thanks but this is to run a transformation, I am trying to run a job with arguments does the same method hold good for jobs also (forgive me I am a Java novice)

    Thanks
    Shri

  4. #4
    Join Date
    Jul 2007
    Posts
    1,013

    Default

    Ah, in that case you can use the Job.setArguments or Job.setArgumentStrings methods:

    http://javadoc.pentaho.com/kettle/org/pentaho/di/job/JobExecutionConfiguration.html#setArgumentStrings(java.lang.String[])

  5. #5

    Default

    Quote Originally Posted by tdidomenico View Post
    Ah, in that case you can use the Job.setArguments or Job.setArgumentStrings methods:

    http://javadoc.pentaho.com/kettle/org/pentaho/di/job/JobExecutionConfiguration.html#setArgumentStrings(java.lang.String[])

    Thanks that did the trick, we were using the setparameter method, so even though I could see the values being passed in, the job was failing. Now we have automated our app to call a kettle job

    Thanks
    Shri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.