We have developed mobile application by using phonegap. We are connecting to the backend by using Google Cloud endpoints. We have written our api's at server side
using java(Google App engine) to get the data. Every thing was working fine but suddenly i got the following exception:
Code Snippet: com.google.api.server.spi.SystemService invokeServiceMethod: cause={0}
java.lang.NullPointerException
at com.veersoft.services.api.ListTenantAPI.listTenant(ListTenantAPI.java:49) 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:45) at com.google.api.server.spi.SystemService.invokeServiceMethod(SystemService.java:359) at com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:160) at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:118) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:142) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66) at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:30) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59) at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438) at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445) at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309) at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301) at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442) at java.lang.Thread.run(Thread.java:724)
代码段:com.google.api.server.spi.SystemService invokeServiceMethod:cause = {0} java.lang.NullPointerException位于sun.reflect的com.veersoft.services.api.ListTenantAPI.listTenant(ListTenantAPI.java:49)。 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)中的NativeMethodAccessorImpl.invoke0(Native Method)位于sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)的java.lang.reflect.Method.invoke(方法。 java:45)com.google.api.server.spi.SystemService.invokeServiceMethod(SystemService.java:359)com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:160)com.google .api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:118)位于javax.servlet.http.HttpServlet.service(HttpServlet.java:637)的javax.servlet.http.HttpServlet.service(HttpServlet.java:717) )org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)at org.mortbay.jetty.servlet.ServletHandler $ CachedChain.d oFilter(ServletHandler.java:1166)位于org.mortbay.jetty.servlet.ServletHandler的com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:142)$ CachedChain.doFilter(ServletHandler.java:1157) com.google.inject.servject.servil.Adject.defocation.doFilter上的com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)com.google.inject.servlet.ManjectFilter.Davatch.ManjectFilterPipeline.java (GuiceFilter.java:113)位于org.mortbay的com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:30)的org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)。在com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)的com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:)中的jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157): 49)at org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler .java:1157)org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)at org。在org.mortbay.jetty.servlet.ServletHandler的org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)的mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)。句柄(ServletHandler.java:388)位于org.mortbay的org.mortbay.jetty.securityHandler.handle(SecurityHandler.java:216)org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)位于org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)的.jetty.handler.ContextHandler.handle(ContextHandler.java:765)org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java) :152)atg.mortbay.jetty.Server.handle(Server.java:326)atg.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)atg.mortbay.jetty.HttpConnection $ Reque stHandler.headerComplete(HttpConnection.java:923)atg.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)com.google.tracing.TraceContext $ TraceContextRunnable.runInContext(TraceContext.java:438)com.google .tracing.TraceContext $ TraceContextRunnable $ 1.run(TraceContext.java:445)com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)com.google.tracing.TraceContext $ AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java: 309)com.google.tracing.TraceContext $ AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)at com.google.tracing.TraceContext $ TraceContextRunnable.run(TraceContext.java:442)at java.lang.Thread.run(Thread的.java:724)
E 2014-10-03 10:00:48.322
com.google.api.server.spi.SystemService invokeServiceMethod: null
java.lang.NullPointerException
at com.veersoft.services.api.ListTenantAPI.listTenant(ListTenantAPI.java:49)
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:45)
at com.google.api.server.spi.SystemService.invokeServiceMethod(SystemService.java:359)
at com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:160)
at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:142)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:66)
at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.veersoft.filter.ResetUserMessagesAndErrorsFilter.doFilter(ResetUserMessagesAndErrorsFilter.java:30)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.googlecode.objectify.cache.AsyncCacheFilter.doFilter(AsyncCacheFilter.java:59)
at com.googlecode.objectify.ObjectifyFilter.doFilter(ObjectifyFilter.java:49)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:438)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:445)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:309)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:301)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:442)
at java.lang.Thread.run(Thread.java:724)
The data is coming fine after some time but i do not know why the above exception comes suddenly, I am worrying that it might be occur in the future? I have gone through my api, every thing is fine. Could any body please tell me how to resolve this?
数据在一段时间后变得很好,但我不知道为什么突然出现上述异常,我担心它可能会在将来发生?我已经完成了我的api,一切都很好。请问有谁可以告诉我如何解决这个问题?
0
If you look at your stack trace, it's clear that your Endpoints API method (com.veersoft.services.api.ListTenantAPI.listTenant
) is where the null pointer exception (NPE) occurs. Without seeing your code, we can't know what the exact NPE is, but the stack trace does give you the line number, so you can inspect ListTenantAPI.java
at line 49 to figure out what's happening.
如果查看堆栈跟踪,很明显您的Endpoints API方法(com.veersoft.services.api.ListTenantAPI.listTenant)是空指针异常(NPE)发生的位置。在没有看到您的代码的情况下,我们无法知道确切的NPE是什么,但堆栈跟踪确实为您提供了行号,因此您可以在第49行检查ListTenantAPI.java以了解发生了什么。
You need to look into your client code and possibly into phonegap to figure out why listTenant()
is having a NPE thrown.
您需要查看您的客户端代码,并可能进入phonegap,以找出为什么listTenant()正在抛出NPE。