Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Setting Kettle.properties file path in java

  1. #1

    Question Setting Kettle.properties file path in java

    Hi Everyone,

    I'm trying to execute job from java code.

    Following is the piece of code i am using for this.

    public static void runJob(String filename)
    {
    LogWriter log = LogWriter.getInstance(LogWriter.LOG_LEVEL_DETAILED);
    try {
    StepLoader.init();
    EnvUtil.environmentInit();
    JobEntryLoader.init();

    StepLoader stepLoader = StepLoader.getInstance();
    JobMeta jobMeta = new JobMeta(log);
    jobMeta = new JobMeta(log, filename.toString(), null, null);
    Job job = new Job(log, stepLoader, null, jobMeta);
    job.execute();
    job.waitUntilFinished();
    }
    catch ( KettleException e ) {
    System.out.println(e);

    }
    }

    while executing this i'm getting file not found exception for "Kettle.properties" file from location "C:\Documents and Settings\username" directory.But my kettle.properties file is in "c:\Kettle" directory.

    Now my question is how i can set this path in above java code?
    Please help me on this.
    Thanks in advance.

    Thanks,
    pplvinay

  2. #2
    Join Date
    Feb 2009
    Posts
    321

    Default

    I think you should read this first http://forums.pentaho.org/showthread...ht=kettle_home.... mmm the variable kettle home must be change.

  3. #3

    Question

    I have already changed KETTLE_HOME variable and Job is executing fine from SPOON. i'm getting error when i'm executing from custom java code.

    Thanks,
    pplvinay

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.