我准备使用kettle api动态执行一个作业。在这个过程中,我需要从XML文件加载转换。 问题:从XML文件加载转换[null]
代码:
KettleEnvironment.init();
JobMeta jobMeta = new JobMeta();
jobMeta.setName("jobMeta");
int x=50,y =50;
JobEntryCopy startCopy = JobMeta.createStartEntry();
startCopy.setLocation(x, y);
startCopy.setDrawn();
jobMeta.addJobEntry(startCopy);
JobEntryCopy lastCopy = startCopy;
JobEntryTrans jobEntryTrans = new JobEntryTrans("transData.ktr");
jobEntryTrans.setSpecificationMethod(
ObjectLocationSpecificationMethod.FILENAME);
JobEntryCopy transCopy = new JobEntryCopy(jobEntryTrans);
transCopy.setName("Execute" + GlobalMethodAndParams.TRANS_NAME);
transCopy.setDrawn();
jobMeta.addJobEntry(transCopy);
JobHopMeta transHop = new JobHopMeta(lastCopy,transCopy);
jobMeta.addJobHop(transHop);
lastCopy = transCopy;
Job job = new Job(null,jobMeta);
job.start();
job.waitUntilFinished();
感谢
答案 0 :(得分:0)
这一行
JobEntryTrans jobEntryTrans = new JobEntryTrans("transData.ktr");
很可能意味着" 在启动jvm的目录中传输transData.ktr "。至少尝试绝对文件路径。