简体   繁体   中英

Failed to execute Kettle job file by java

It's my first time to deal with Pentaho Data Integration, so i'm trying to execute the job from the java, but i failed to to this ! although of the job is working good from Spoon .

this is my code:

jobMeta = new JobMeta(LogWriter.getInstance(), "E:\\rubbish\\job.kjb", null);
Job job = new Job(LogWriter.getInstance(), null , jobMeta);
job.start();
job.waitUntilFinished();

and this is the result which has an error !:

!INFO  01-07 16:32:03,305 - Using "C:\Users\AALKHA~1\AppData\Local\Temp\vf
_cache" as temporary files store.
ERROR 01-07 16:32:03,468 - null.0 - Unable to read Job Entry copy info from XML
node : org.pentaho.di.core.exception.KettleStepLoaderException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL

ERROR 01-07 16:32:03,471 - null.0 - org.pentaho.di.core.exception.KettleStepLoa
erException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL

        at org.pentaho.di.job.entry.JobEntryCopy.<init>(JobEntryCopy.java:110)
        at org.pentaho.di.job.JobMeta.loadXML(JobMeta.java:922)
        at org.pentaho.di.job.JobMeta.<init>(JobMeta.java:726)
        at org.pentaho.di.job.JobMeta.<init>(JobMeta.java:693)
        at ingramint.steps.fullIntStep.step1(fullIntStep.java:62)
        at ingramint.steps.fullIntStep.<init>(fullIntStep.java:32)
        at ingramint.libs.menuLib.mainMenu(menuLib.java:75)
        at ingramint.Main.main(Main.java:24)

Jul 01, 2014 4:32:03 PM ingramint.steps.fullIntStep step1
SEVERE: null
org.pentaho.di.core.exception.KettleXMLException:
Unable to load the job from XML file [E:\rubbish\job.kjb]

Unable to load job info from XML node

Unable to read Job Entry copy info from XML node : org.pentaho.di.core.exceptio
.KettleStepLoaderException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL


No valid step/plugin specified (jobPlugin=null) for SPECIAL




        at org.pentaho.di.job.JobMeta.<init>(JobMeta.java:734)
        at org.pentaho.di.job.JobMeta.<init>(JobMeta.java:693)
        at ingramint.steps.fullIntStep.step1(fullIntStep.java:62)
        at ingramint.steps.fullIntStep.<init>(fullIntStep.java:32)
        at ingramint.libs.menuLib.mainMenu(menuLib.java:75)
        at ingramint.Main.main(Main.java:24)
Caused by: org.pentaho.di.core.exception.KettleXMLException:
Unable to load job info from XML node

Unable to read Job Entry copy info from XML node : org.pentaho.di.core.exceptio
.KettleStepLoaderException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL


No valid step/plugin specified (jobPlugin=null) for SPECIAL



        at org.pentaho.di.job.JobMeta.loadXML(JobMeta.java:968)
        at org.pentaho.di.job.JobMeta.<init>(JobMeta.java:726)
        ... 5 more
Caused by: org.pentaho.di.core.exception.KettleXMLException:
Unable to read Job Entry copy info from XML node : org.pentaho.di.core.exceptio
.KettleStepLoaderException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL


No valid step/plugin specified (jobPlugin=null) for SPECIAL


        at org.pentaho.di.job.entry.JobEntryCopy.<init>(JobEntryCopy.java:134)
        at org.pentaho.di.job.JobMeta.loadXML(JobMeta.java:922)
        ... 6 more
Caused by: org.pentaho.di.core.exception.KettleStepLoaderException:
No valid step/plugin specified (jobPlugin=null) for SPECIAL

        at org.pentaho.di.job.entry.JobEntryCopy.<init>(JobEntryCopy.java:110)
        ... 7 more

i'm using theses jars:

  • kettle-core-3.2.2.jar

  • kettle-db-3.2.2.jar

  • kettle-engine-3.2.2.jar

so any suggestions please ?

Thank you,

Once have a look at the code pasted below and it worked. You need to add all the Jars present in the data-integration/lib to the classpath not only the ones you have mentioned above.

   public class ExecuteJob {
   public static void main(String[] args) throws Exception {
  String filename = args[0];
  KettleEnvironment.init();
  JobMeta jobMeta = new JobMeta(filename, null);
  Job job = new Job(null, jobMeta);
  job.start();
  job.waitUntilFinished();
  if (job.getErrors()!=0) {
    System.out.println(“Error encountered!”);
 } }
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM