Six Stars

Catch all exceptions/errors

Hi, this is how I get all the exceptions and errors from my job:

 

1.JPG

 

But now I just got an error/exception that don't stop the programa and is not caught by the logcatcher.

 

1.JPG

 

2.JPG

 

How is this happening?

  • ESB
Tags (1)
8 REPLIES
Eleven Stars

Re: Catch all exceptions/errors

Are you sure this is not stopping the job? What is the last thing that you see in your error log file?

 

Rilhia Solutions
Moderator

Re: Catch all exceptions/errors

Hello,

We need more information to allocate the cause why it is a NPE on your tXMLMap component.

Is the attached file full stack trace? Have you defined any expression in tXMLMap? Screenshots of tXMLMap component setting will be preferred.

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.
Six Stars

Re: Catch all exceptions/errors

Yes, because it's a webservice. This is the error log.

 

Exception in component tXMLMap_10
java.lang.NullPointerException
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_8Process(IPayment_CommitTransaction.java:14640)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_16Process(IPayment_CommitTransaction.java:13811)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tJava_1Process(IPayment_CommitTransaction.java:12083)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_5Process(IPayment_CommitTransaction.java:11865)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_4Process(IPayment_CommitTransaction.java:11121)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_3Process(IPayment_CommitTransaction.java:10459)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlInput_2Process(IPayment_CommitTransaction.java:8793)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tHashInput_1Process(IPayment_CommitTransaction.java:5733)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tHashInput_2Process(IPayment_CommitTransaction.java:4508)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlConnection_1Process(IPayment_CommitTransaction.java:2831)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tESBProviderRequest_1_LoopProcess(IPayment_CommitTransaction.java:51681)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.runJobInTOS(IPayment_CommitTransaction.java:52301)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.main(IPayment_CommitTransaction.java:51932)
Jul 07, 2017 10:55:59 AM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
WARNING: Application {http://xml.hugwi.ch/2011/06/spider/backoffice}ImplOfIPayment#{http://xml.hugwi.ch/2011/06/spider/bac... has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Talend job execution error:
    at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:267)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)
    at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:85)
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:74)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
    at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:234)
    at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Talend job execution error:
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction$ESBProviderCallbackTalendJobWrapper_tESBProviderRequest_1.sendFault(IPayment_CommitTransaction.java:2562)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction$ESBProviderCallbackTalendJobWrapper_tESBProviderRequest_1.sendFaultByDefault(IPayment_CommitTransaction.java:2571)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tESBProviderRequest_1_LoopProcess(IPayment_CommitTransaction.java:51726)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.runJobInTOS(IPayment_CommitTransaction.java:52301)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.main(IPayment_CommitTransaction.java:51932)
Caused by: local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction$TalendException
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tMSSqlConnection_1Process(IPayment_CommitTransaction.java:2840)
    at local_project.ipayment_committransaction_0_1.IPayment_CommitTransaction.tESBProviderRequest_1_LoopProcess(IPayment_CommitTransaction.java:51681)
    ... 2 more

Eleven Stars

Re: Catch all exceptions/errors

Ah , I see. First of all Web Services behave in a slightly different way to batch jobs. Having said that, I would still expect the log catcher to catch the NPE even if it doesn't stop the service. Services are a little more resilient.

 

To find the cause of your NPE you need to go to the code tab and look at line 14640 of your code. That should show you enough to figure out what field in your tXMLMap is null

Rilhia Solutions
Six Stars

Re: Catch all exceptions/errors

This is the screen of the TXMLMAP. I know why I am getting the error, it's because a variable is null but I am not being able to catch the error. Remember it's a webservice

 

1.JPG

Six Stars

Re: Catch all exceptions/errors

I already know which variable is null, I put this on purpose but I need to save all the errors.

It's going to be a really big webservice and I need to now exactly where the errors are produced in order to fix them fast.

Eleven Stars

Re: Catch all exceptions/errors

Is this a REST service? What version of Talend is this? I have just tested this (on v6.2.1) and it works for me. When I get a NPE the tLogCatcher picks it up and logs it (to my output in this case). The service won't stop because that is not how services work. 

 

All it will tell you is that there has been a Java Exception and that it is a NPE. If you want the error stack you will need to look at you runtime logs (where it will definitely appear).

 

Rilhia Solutions
Six Stars

Re: Catch all exceptions/errors

Hi,

 

First of all, thank you for helping me again.

 

The talend version is 6.3, for esb. It's a soap service, I will check what you say about the runtime logs but I would really need to catch this error and put this on a file.