Building the job is not working from the command line

One Star

Building the job is not working from the command line

Our approach is to create Talend jobs automatically and then run these jobs using command line what we are doing is the following:
 
1.      Create the Job Scripts dynamically using java and the inputs from the Database.
2.      Run the below commands in order to create a dummy project, create a job under this project using the jobScript generated and then Build the job in order to run the jobs anytime it is needed, below is the code we are using to create the project, create job and build:
a.      Talend-Studio-win32-x86.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace  initLocal  createProject -pn Applicant_List_Stg_Master -pd Talend -pl java -pa Talend
b.       Talend-Studio-win32-x86.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace  initLocal  logonProject  -pn Applicant_List_Stg_Master -ul Talend createJob Applicant_List_Stg_Master -sf "D:/SSP/ETL/MOFLEP/AE/Child/JS/Applicant_List_Stg_Master.JobScript" -o  logoffProject 
c.       Talend-Studio-win32-x86.exe -nosplash -application org.talend.commandline.CommandLine -consoleLog -data commandline-workspace  initLocal  logonProject  -pn Applicant_List_Stg_Master -ul Talend buildJob Applicant_List_Stg_Master -dd "C:/Users/cantoun/Desktop" -af "xxxxxx.zip"
 Commands a and b are running successfully and the project is being created, but when I try to build the job it gives an error, maybe I am doing something wrong not sure. Please find attached the error, Job Script and batch file containing the Talend commands.

Please find below the errors I am facing: 

ERROR: Error during JetEmitter initalizationException onHeader_routeJava
org.eclipse.emf.codegen.jet.JETException: Exception onHeader_routeJava
        at org.talend.designer.codegen.config.TalendJetEmitter$TalendEclipseHelp
er.initialize(TalendJetEmitter.java:390)
        at org.talend.designer.codegen.config.TalendJetEmitter.initialize(Talend
JetEmitter.java:151)
        at org.talend.designer.codegen.config.TalendJetEmitter.initialize(Talend
JetEmitter.java:140)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.sy
nchronizedComponent(CodeGeneratorEmittersPoolFactory.java:522)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.in
itializeEmittersPool(CodeGeneratorEmittersPoolFactory.java:485)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.ac
cess$6(CodeGeneratorEmittersPoolFactory.java:437)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory$Jo
bRunnable.doRun(CodeGeneratorEmittersPoolFactory.java:193)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory$Jo
bRunnable.run(CodeGeneratorEmittersPoolFactory.java:124)
Caused by: org.eclipse.emf.codegen.jet.JETException: The file 'platform:/plugin/
org.talend.designer.codegen_5.6.1.20141207_1530/resources/@{org.talend.designer.
camel.components.localprovider}/components/cCXF/cCXF_uri.javajet' cannot be read
 in 'platform:/plugin/org.talend.designer.codegen_5.6.1.20141207_1530/resources/
header_route.javajet' at line 1,087 column 5
        at org.eclipse.emf.codegen.jet.JETCompiler.handleDirective(JETCompiler.j
ava:214)
        at org.talend.designer.codegen.config.TalendJETCompiler.handleDirective(
TalendJETCompiler.java:89)
        at org.eclipse.emf.codegen.jet.JETParser$DelegatingListener.handleDirect
ive(JETParser.java:133)
        at org.eclipse.emf.codegen.jet.JETParser$Directive.accept(JETParser.java
:444)
        at org.eclipse.emf.codegen.jet.JETParser.parse(JETParser.java:512)
        at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:632)
        at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:625)
        at org.talend.designer.codegen.config.TalendJetEmitter$TalendEclipseHelp
er.initialize(TalendJetEmitter.java:271)
        ... 7 more
Caused by: org.eclipse.emf.codegen.jet.JETException: /resources/@{org.talend.des
igner.camel.components.localprovider}/components/cCXF/cCXF_uri.javajet
        at org.eclipse.emf.codegen.jet.JETCompiler.openStream(JETCompiler.java:7
59)
        at org.eclipse.emf.codegen.jet.JETCompiler.handleDirective(JETCompiler.j
ava:185)
        ... 14 more
Caused by: java.io.FileNotFoundException: /resources/@{org.talend.designer.camel
.components.localprovider}/components/cCXF/cCXF_uri.javajet
        at org.eclipse.osgi.framework.internal.protocol.bundleentry.Handler.find
BundleEntry(Handler.java:44)
        at org.eclipse.osgi.framework.internal.core.BundleResourceHandler.openCo
nnection(BundleResourceHandler.java:175)
        at java.net.URL.openConnection(Unknown Source)
        at org.eclipse.core.internal.boot.PlatformURLConnection.connect(Platform
URLConnection.java:110)
        at org.eclipse.core.internal.boot.PlatformURLConnection.connect(Platform
URLConnection.java:91)
        at org.eclipse.core.internal.boot.PlatformURLConnection.getInputStream(P
latformURLConnection.java:229)
        at java.net.URL.openStream(Unknown Source)
        at org.eclipse.emf.codegen.jet.JETCompiler.openStream(JETCompiler.java:7
54)
        ... 15 more

!ENTRY org.talend.platform.logging 4 0 2015-02-11 09:33:01.646
!MESSAGE 2015-02-11 09:33:01,641 ERROR org.talend.designer.codegen.model.CodeGen
eratorEmittersPoolFactory  - Error during JetEmitter initalizationException onHe
ader_routeJava

!STACK 0
org.eclipse.emf.codegen.jet.JETException: Exception onHeader_routeJava
        at org.talend.designer.codegen.config.TalendJetEmitter$TalendEclipseHelp
er.initialize(TalendJetEmitter.java:390)
        at org.talend.designer.codegen.config.TalendJetEmitter.initialize(Talend
JetEmitter.java:151)
        at org.talend.designer.codegen.config.TalendJetEmitter.initialize(Talend
JetEmitter.java:140)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.sy
nchronizedComponent(CodeGeneratorEmittersPoolFactory.java:522)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.in
itializeEmittersPool(CodeGeneratorEmittersPoolFactory.java:485)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory.ac
cess$6(CodeGeneratorEmittersPoolFactory.java:437)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory$Jo
bRunnable.doRun(CodeGeneratorEmittersPoolFactory.java:193)
        at org.talend.designer.codegen.model.CodeGeneratorEmittersPoolFactory$Jo
bRunnable.run(CodeGeneratorEmittersPoolFactory.java:124)
Caused by: org.eclipse.emf.codegen.jet.JETException: The file 'platform:/plugin/
org.talend.designer.codegen_5.6.1.20141207_1530/resources/@{org.talend.designer.
camel.components.localprovider}/components/cCXF/cCXF_uri.javajet' cannot be read
 in 'platform:/plugin/org.talend.designer.codegen_5.6.1.20141207_1530/resources/
header_route.javajet' at line 1,087 column 5
        at org.eclipse.emf.codegen.jet.JETCompiler.handleDirective(JETCompiler.j
ava:214)
        at org.talend.designer.codegen.config.TalendJETCompiler.handleDirective(
TalendJETCompiler.java:89)
        at org.eclipse.emf.codegen.jet.JETParser$DelegatingListener.handleDirect
ive(JETParser.java:133)
        at org.eclipse.emf.codegen.jet.JETParser$Directive.accept(JETParser.java
:444)
        at org.eclipse.emf.codegen.jet.JETParser.parse(JETParser.java:512)
        at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:632)
        at org.eclipse.emf.codegen.jet.JETCompiler.parse(JETCompiler.java:625)
        at org.talend.designer.codegen.config.TalendJetEmitter$TalendEclipseHelp
er.initialize(TalendJetEmitter.java:271)
        ... 7 more
Caused by: org.eclipse.emf.codegen.jet.JETException: /resources/@{org.talend.des
igner.camel.components.localprovider}/components/cCXF/cCXF_uri.javajet
        at org.eclipse.emf.codegen.jet.JETCompiler.openStream(JETCompiler.java:7
59)
        at org.eclipse.emf.codegen.jet.JETCompiler.handleDirective(JETCompiler.j
ava:185)
        ... 14 more
Caused by: java.io.FileNotFoundException: /resources/@{org.talend.designer.camel
.components.localprovider}/components/cCXF/cCXF_uri.javajet
        at org.eclipse.osgi.framework.internal.protocol.bundleentry.Handler.find
BundleEntry(Handler.java:44)
        at org.eclipse.osgi.framework.internal.core.BundleResourceHandler.openCo
nnection(BundleResourceHandler.java:175)
        at java.net.URL.openConnection(Unknown Source)
        at org.eclipse.core.internal.boot.PlatformURLConnection.connect(Platform
URLConnection.java:110)
        at org.eclipse.core.internal.boot.PlatformURLConnection.connect(Platform
URLConnection.java:91)
        at org.eclipse.core.internal.boot.PlatformURLConnection.getInputStream(P
latformURLConnection.java:229)
        at java.net.URL.openStream(Unknown Source)
        at org.eclipse.emf.codegen.jet.JETCompiler.openStream(JETCompiler.java:7
54)
        ... 15 more
Employee

Re: Building the job is not working from the command line

There are multiple ways of interacting with the commandline.  These are document in Appendix A.2 of the TAC User's Guide.  You are currently using Stand-alone mode.  This is pretty inefficient since each time you are in effect spinning up the commandline, sending commands, and then shutting it down again.  It is also very hard to debug or even to read the ultra long command lines.  However, if you do follow this approach note that you need to separate commands with a ";".  (This factoid is somewhat hidden since it is only mentioned in the output of the help command itself.
I would suggest first that you use Shell mode to interactively type in the commands to find the correct syntax.  This will save you a lot of time.  Capture the commands into a script file and then test again using script mode.
Same goes for the jobscript itself.  Since you have an Enterprise version of the product you have access to the JobScript pane in the designer.  So you can just create a new empty job, paste in your script, and see if it compiles.  Conversely, you can design the same job visually in the designer, go to the JobScript tab, and copy out the JobScript to use as a template for your own design.
One Star

Re: Building the job is not working from the command line

Hi,  based on your error log it seems like it would be an issue with the jobscript itself.  Typically this is easily fixed by as eost mentioned placing your jobscript into an empty job, in the jobscript tab.  The error message will surface as a red rectangle next to the offending line.  If you would post your jobscript to the forum, I can take a quick look and provide the fix for you.  I have been doing jobscripting for quite some time and this looks like a small error in the jobscript syntax. 
The jobscript code editor should also work for you if you paste your jobscript there as well.
Best Regards