Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Not able to run a Kettle Job through Java Code

  1. #1
    Join Date
    Aug 2008
    Posts
    9

    Default Not able to run a Kettle Job through Java Code

    I am getting this error when I am trying to run a kettle job through my Java Code.
    ---------------------
    JobEntryLoader was unable to find Job Entry Plugin with description [SPECIAL].
    ----------------------

    I could execute it through the Kettle UI. Here is a snippet of my code


    try {
    StepLoader.init();
    EnvUtil.environmentInit();
    UserInfo usr = new UserInfo("admin", "admin", "Test Repository", "", false, new ProfileMeta());
    DatabaseMeta dbMeta = new DatabaseMeta("testRepo", "Oracle", "Native (JDBC)",
    "xyzabc.com", "xyzabc" ,
    "1520", "xyzabc", "xyzabc1234");
    RepositoryMeta repoMeta = new RepositoryMeta("Test Repository", "", dbMeta);
    Repository repo = new Repository(LogWriter.getInstance(), repoMeta, usr);
    repo.connect(true, true, "from admin web app program");
    //RepositoryDirectory repoDir = repo.getDirectoryTree();
    RepositoryDirectory repoDir = new RepositoryDirectory(repo);
    System.out.println("Id= "+repoDir.getID()+" Pentaho Job name "+jobName );
    JobMeta jobMeta = new JobMeta(LogWriter.getInstance(), repo, jobName, repoDir);
    StepLoader stepLoader = StepLoader.getInstance();
    JobEntryLoader jeloader = JobEntryLoader.getInstance();
    JobPlugin jobPLugin = jeloader.findJobEntriesWithID("START");
    System.out.println("Job Pluggin...."+ jobPLugin.getID());
    Job job = new Job(LogWriter.getInstance(), stepLoader, repo, jobMeta);
    job.execute();
    if ( job.getErrors() > 0 )
    {
    throw new RuntimeException( "There were errors during job execution." );
    }
    }
    catch ( KettleException e ) {
    System.out.println(e);
    }
    }

    --------------------
    I do have a Start job entry which is of type SPECIAL.
    Is there a step I am missing.

    Thanks

  2. #2
    Join Date
    Nov 2008
    Posts
    143

    Default

    Bump...
    Any word about a solution?

    EDIT:
    Never mind. I just found out I forgot to add the following to the code:
    Code:
    StepLoader.init();
    JobEntryLoader.init();
    Last edited by renatopb; 04-12-2010 at 01:49 PM. Reason: Solution found.

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.