Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: starting job in Carte

  1. #1
    Join Date
    Apr 2008
    Posts
    2

    Post starting job in Carte

    Hello again,

    i know i am a rookie in pdi an my questions seems maybe to simple for that forum. but iam working on it. so this is my second try getting an answer for my problem.
    I try to read an kjb file adding it to a jobmap and give that jobmap to carte
    to start it. i made the same with a ktr file an it works very well.
    but when i start carte with the code i get the following message:


    svys01:/usr/local/datamining/kettle-spoon# ./carte 172.16.2.130 8180
    2008/09/08 13:05:45:770 CEST [INFO] DefaultFileReplicator -Using "/tmp/vfs_cache" as temporary files store.
    Exception in thread "main" java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:399)
    at org.pentaho.di.www.JobMap.addJob(JobMap.java:48)
    at org.pentaho.di.www.Carte.(Carte.java:75)
    at org.pentaho.di.www.Carte.runCarte(Carte.java:118)
    at org.pentaho.di.www.Carte.main(Carte.java:98)


    this is my code:
    //job
    FileObject fileObject = KettleVFS.getFileObject("file:////INTEX.kjb");
    InputStream inputStream = KettleVFS.getInputStream(fileObject);
    StringBuffer xml = new StringBuffer();
    int c;
    while ((c=inputStream.read()) != -1) xml.append((char)c);
    StepLoader.init();
    JobEntryLoader.init();
    JobConfiguration jobConfiguration = JobConfiguration.fromXML(xml.toString());
    JobMeta jobMeta = jobConfiguration.getJobMeta();
    JobExecutionConfiguration jobExecutionConfiguration = jobConfiguration.getJobExecutionConfiguration();
    jobMeta.setArguments(jobExecutionConfiguration.getArgumentStrings());
    Repository repository = jobConfiguration.getJobExecutionConfiguration().getRepository();
    Job job = new Job(LogWriter.getInstance(), StepLoader.getInstance(), repository, jobMeta);
    job.initializeVariablesFrom(null);
    job.injectVariables(jobConfiguration.getJobExecutionConfiguration().getVariables());
    job.getJobMeta().setInternalKettleVariables(job);
    jobMap.addJob(jobMeta.getName(), job, jobConfiguration);
    //Job

  2. #2
    DEinspanjer Guest

    Default

    Looking at the code, I'd suspect that for some reason, jobMeta.getName() is returning a null?

  3. #3
    Join Date
    Apr 2009
    Posts
    26

    Default

    Hello,

    I try to read an kjb file adding it to a jobmap and give that jobmap to carte
    to start it. i made the same with a ktr file an it works very well.
    Please, could you share the Java code to load transformations in Carte?

    Did you finally achieve job loading without errors?

    I'm rookie too and I will appreciate your help.

    Thanks in advance.


    Regards,
    Mikel.

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.