One Star

NullPointerException when running rest web service

Hi
 
I’m a new user of Talend Open Studio.
I’m trying to make a student system which has the following functions:
·         get the scores of a clas which is specified by “major”, “grade”, “class_id”
·         get the scores of a student, in current year, which is specified by “student_id”
·        
I can get a good reponse with both of the two output flow “getNotes” and “getNote”
But when I test the output flow “getNote”,  there are always an Exception :
Exception in component tSetGlobalVar_1
java.lang.NullPointerException
      at student.test_0_1.test.tRESTRequest_1_LoopProcess(test.java:10336)
     at student.test_0_1.test$RestServiceProviderImpl4TalendJob.processRequest(test.java:792)
      at student.test_0_1.test$RestServiceProviderImpl4TalendJob.getNote(test.java:897)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:188)
      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)
      at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:204)
      at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:94)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:355)
      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:319)
     at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:65)
      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.headerComplete(AbstractHttpConnection.java:971)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
     at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
      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(Thread.java:722)
Comparing the two output flows, I think that, normally, which we try to test an output flow, there should be a green line “1 rows in *s” on the output flow which is called and a green line “0 rows in*s” on other output flows
So I want to know why, when I test the output flow « getNote », I get  ”1 rows -0.03s” on the output flow « getNote » and "starting" on others , what does the blue line”1 rows -0.03s” means? After all, I get a good reponse.
Waiting for your reply! Thanks in advance!
6 REPLIES
Fifteen Stars

Re: NullPointerException when running rest web service

Can you take a screenshot of your job and also of your tSetGlobalVar configuration? The problem is with the tSetGlobalVar.
Rilhia Solutions
One Star

Re: NullPointerException when running rest web service

I uploaded, but I don't think the problem is there. Please view the region I specified in the other pictures. I really want to know what does it means "1 rows -0.03s". Thanks!
One Star

Re: NullPointerException when running rest web service

Here it is, please see also the zones  I specified in blue and red.
Fifteen Stars

Re: NullPointerException when running rest web service

The Java is falling over because of a NullPointerException with the tSetGlobalVar component. It might not be that component that is the root cause, but in order to help with this we will need to see the Job and the tSetGlobalVar configuration. Have you tried to send screenshots? We cannot see them here. This may be because this forum has security on the number of posts you have to send before images are allowed (although they claim they do not, it is a consistent issue). Either try posting a few posts to get up to 10 or mail me admin@rilhia.com with the screenshots and I will post them, hopefully with a suggestion.
Rilhia Solutions
Moderator

Re: NullPointerException when running rest web service

Hi e4259,
No limitation exists for the image. You can upload images for the first topic/post.
Please drag&drop the image directly in the editor window if you use "Upload" button.
Please take a look at my screenshot.

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

Re: NullPointerException when running rest web service

You say that xdshi, but when I rejoined a couple of weeks ago I had that issue. It is also quite clear that others are having it. For me (a couple of weeks ago) it actually said that until I had posted 10 posts that I would not be able to post images.
Rilhia Solutions