One Star

[resolved] Running batch file Error

Hi everyone,
When I run the batch file of an exported job, java.lang.NullPointerException occurs.
I have used "tWebService" item in that job.When I run that job in Talend, everything works fine.
When I run the batch file, the error "java.lang.NullPointerException" occurs.
When I run the batch file of job without using tWebService item, everything works fine.
I think some java setting I have made is wrong. But I don't exactly know which setting is the reason.
Other Informations:
TDI 5.5.0
Java : jdk1.7.0_17
Talend Java Interpreter Setting : C:\Program Files\Java\jdk1.7.0_17\bin\java.exe
Build Job  -> Bulid Type -> Standalone Job.
Error Details:
Exception in component tWebService_1
java.lang.NullPointerException
        at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:19
0)
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:144)
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:139)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.compileJavaSrc(D
ynamicClientFactory.java:610)
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(Dyn
amicClientFactory.java:369)
        at org.talend.webservice.helper.ServiceInvokerHelper.createClient(Servic
eInvokerHelper.java:144)
        at org.talend.webservice.helper.ServiceInvokerHelper.getClient(ServiceIn
vokerHelper.java:135)
        at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvok
erHelper.java:236)
        at ws_test.customermasterupdatews_1_1.CustomerMasterUpdateWS.tFileInputD
elimited_1Process(CustomerMasterUpdateWS.java:1559)
        at ws_test.customermasterupdatews_1_1.CustomerMasterUpdateWS.runJobInTOS
(CustomerMasterUpdateWS.java:1905)
        at ws_test.customermasterupdatews_1_1.CustomerMasterUpdateWS.main(Custom
erMasterUpdateWS.java:1788)
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] Running batch file Error

Hi Jcs19,
It occurs another error.
.
Regards, May T.

Use \ instead of /
and make sure you didn't forget quotes
14 REPLIES
Four Stars

Re: [resolved] Running batch file Error

Hi May,
Can you show the webservices screenshot and job design?
Vaibhav
One Star

Re: [resolved] Running batch file Error

Hi Vaibhav,
This is my job design.


Regards, May T.
One Star

Re: [resolved] Running batch file Error

Hello,
1) Is your batch file on the same machine ? 
2) Sometimes the batch file exported by Talend is not using the same java as in Talend Open Studio and it may create bugs
To force the batch file to use the same version : 
go to TOS, click on window -> preferences -> talend -> Java interpreter and copy the path (ex : C:\Program Files (x86)\Java\jre7\bin\java.exe)
Now right click your batch file, edit it and replace "java" by "C:\Program Files (x86)\Java\jre7\bin\java.exe" (or your path)
retry
Moderator

Re: [resolved] Running batch file Error

Hi,
Did you install studio on a machine then execute .bat file in another one? If so, in order to execute Exported Talend Job outside of Talend studio, you also need compatible java version.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Running batch file Error

Hi,
1)Yes.
2)Do you mean manually edit the batch file?
eg; My batch is..
%~d0
 cd %~dp0
 java -Xms256M -Xmx1024M -cp ../lib/activation.jar;../lib/asm-3.3.1.jar;../lib/commons-beanutils-1.8.3.jar;../lib/commons-codec-1.7.jar;../lib/commons-collections-3.2.1.jar;../lib/commons-httpclient-3.1.jar;../lib/commons-lang-2.6.jar;../lib/commons-logging-1.1.1.jar;../lib/cxf-2.7.7-modified.jar;../lib/cxf-xjc-boolean-2.6.2.jar;../lib/cxf-xjc-bug671-2.6.2.jar;../lib/cxf-xjc-dv-2.6.2.jar;../lib/cxf-xjc-runtime-2.6.2.jar;../lib/cxf-xjc-ts-2.6.2.jar;../lib/dom4j-1.6.1.jar;../lib/geronimo-jaxws_2.2_spec-1.1.jar;../lib/httpasyncclient-4.0-beta3.jar;../lib/httpclient-4.2.5.jar;../lib/httpcore-4.2.4.jar;../lib/httpcore-nio-4.2.4.jar;../lib/javax.ws.rs-api-2.0-m10.jar;../lib/jaxb-impl-2.2.6-modified.jar;../lib/jaxb-xjc-2.2.6-modified.jar;../lib/jaxp-api.jar;../lib/jaxp-ri.jar;../lib/mail.jar;../lib/neethi-3.0.2.jar;../lib/serializer-2.7.1.jar;../lib/stax2-api-3.1.1.jar;../lib/talend-ws-1.0.jar;../lib/talendcsv.jar;../lib/talend_file_enhanced_20070724.jar;../lib/velocity-1.7.jar;../lib/woodstox-core-asl-4.2.0.jar;../lib/wsdl4j-1.6.3.jar;../lib/xalan-2.7.1.jar;../lib/xmlschema-core-2.0.3.jar;../lib/systemRoutines.jar;../lib/userRoutines.jar;.;customermasterupdatews_1_1.jar; ws_test.customermasterupdatews_1_1.CustomerMasterUpdateWS --context=Default %*
Do I need to replace "java" to the path "C:\Program Files\Java\jdk1.7.0_17\bin\java.exe"  in above codes?
Regards, May T.
One Star

Re: [resolved] Running batch file Error

Hi Sabrina,

It's same machine.

Regards, May T.
One Star

Re: [resolved] Running batch file Error

Hi,
1)Yes.
2)Do you mean manually edit the batch file?
eg; My batch is..
%~d0
 cd %~dp0
 java -Xms256M -Xmx1024M -cp ../lib/activation.jar;../lib/asm-3.3.1.jar;../lib/commons-beanutils-1.8.3.jar;../lib/commons-codec-1.7.jar;../lib/commons-collections-3.2.1.jar;../lib/commons-httpclient-3.1.jar;../lib/commons-lang-2.6.jar;../lib/commons-logging-1.1.1.jar;../lib/cxf-2.7.7-modified.jar;../lib/cxf-xjc-boolean-2.6.2.jar;../lib/cxf-xjc-bug671-2.6.2.jar;../lib/cxf-xjc-dv-2.6.2.jar;../lib/cxf-xjc-runtime-2.6.2.jar;../lib/cxf-xjc-ts-2.6.2.jar;../lib/dom4j-1.6.1.jar;../lib/geronimo-jaxws_2.2_spec-1.1.jar;../lib/httpasyncclient-4.0-beta3.jar;../lib/httpclient-4.2.5.jar;../lib/httpcore-4.2.4.jar;../lib/httpcore-nio-4.2.4.jar;../lib/javax.ws.rs-api-2.0-m10.jar;../lib/jaxb-impl-2.2.6-modified.jar;../lib/jaxb-xjc-2.2.6-modified.jar;../lib/jaxp-api.jar;../lib/jaxp-ri.jar;../lib/mail.jar;../lib/neethi-3.0.2.jar;../lib/serializer-2.7.1.jar;../lib/stax2-api-3.1.1.jar;../lib/talend-ws-1.0.jar;../lib/talendcsv.jar;../lib/talend_file_enhanced_20070724.jar;../lib/velocity-1.7.jar;../lib/woodstox-core-asl-4.2.0.jar;../lib/wsdl4j-1.6.3.jar;../lib/xalan-2.7.1.jar;../lib/xmlschema-core-2.0.3.jar;../lib/systemRoutines.jar;../lib/userRoutines.jar;.;customermasterupdatews_1_1.jar; ws_test.customermasterupdatews_1_1.CustomerMasterUpdateWS --context=Default %*
Do I need to replace "java" to the path "C:\Program Files\Java\jdk1.7.0_17\bin\java.exe"  in above codes?
Regards, May T.

yes, tell me if its working
One Star

Re: [resolved] Running batch file Error

Hi Jcs19,
It occurs another error.
.
Regards, May T.
One Star

Re: [resolved] Running batch file Error

Hi Jcs19,
It occurs another error.
.
Regards, May T.

Use \ instead of /
and make sure you didn't forget quotes
One Star

Re: [resolved] Running batch file Error

Hi Jcs19,
Great.
After inserting the quotes, it works.
Thanks a lot.
Regards, May T.
One Star

Re: [resolved] Running batch file Error

Hello, 
I'm having the same issue: one of my PostgreSqllnputs is generating a nullpointer exception. I also tried the workaround you did but I'm still receiving the error when executing the job on command line, inside Talend works fine. I'm using a sh file and my environment is Linux Mint 64 bits. Any other tips?
Moderator

Re: [resolved] Running batch file Error

Hi Mandica,
Did you install studio on Window then execute .sh file in Linux server? Could you please give us more information about your current situation?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: [resolved] Running batch file Error

Hello, 
I'm using Talend free version for Data Integration in Linux Mint. I was generating my jobs using the 6.3 version so I installed the 6.2 version and now I'm able to execute them from command line although I received some NullPointerExceptions during my first tests with this older version. 
Since I was using several databases connections (more than 5) within the job I don't know if during the build they got lost due to generated code or something, so the last time I built the job I only used 2 or 3 connections and included all of them at once inside the job, and it started working. 
Any ideas why the 6.3 version jobs don't work after build or about this workaroung with the 6.2 version?
Moderator

Re: [resolved] Running batch file Error

Hi,
We cannot reproduce your issue on V 6.3. It is Ok with us to export batch file from V 6.3 and execute .sh file on the same machine.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.