In case anybody ran into the same error: it seems that the org.mortbay.io.Portable.getBytes() is just poorly designed, so it's not null pointer proof. One of the methods that were filling the headers could possibly return null (request.getPathInfo()), in case there was no additional path info, and so the null propagated down to that faulty method and crashed the whole servlet.
Beware of null pointers. On Apr 28, 8:37 am, ThePablick <[email protected]> wrote: > Last two days, I get this error while running my app: > java.lang.NullPointerException > at org.mortbay.io.Portable.getBytes(Portable.java:46) > at org.mortbay.io.ByteArrayBuffer.<init>(ByteArrayBuffer.java:73) > at org.mortbay.io.ByteArrayBuffer > $CaseInsensitive.<init>(ByteArrayBuffer.java:414) > at org.mortbay.io.BufferCache$CachedBuffer.<init>(BufferCache.java: > 120) > at org.mortbay.io.BufferCache.lookup(BufferCache.java:93) > at org.mortbay.jetty.HttpFields.add(HttpFields.java:612) > at org.mortbay.jetty.Response.addHeader(Response.java:502) > > // this is my class > at > eu.gemstonewebdesign.gauth.service.TokenEndPoint.doGet(TokenEndPoint.java: > 92) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) > 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.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlo > bUploadFilter.java: > 97) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1157) > at > com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionF > ilter.java: > 35) > at org.mortbay.jetty.servlet.ServletHandler > $CachedChain.doFilter(ServletHandler.java:1157) > at > com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans > actionCleanupFilter.java: > 43) > 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 > com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionH > andlerMap.java: > 238) > 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 > com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequ > estParser.java: > 76) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceReques > t(JettyServletEngineAdapter.java: > 135) > at > com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java: > 261) > at com.google.apphosting.base.RuntimePb$EvaluationRuntime > $2.handleRequest(RuntimePb.java:9285) > at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java: > 437) > at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java: > 573) > at com.google.tracing.TraceContext$TraceContextRunnable > $1.run(TraceContext.java:448) > at com.google.tracing.TraceContext.runInContext(TraceContext.java: > 688) > at com.google.tracing.TraceContext > $AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.jav a: > 326) > at com.google.tracing.TraceContext > $AbstractTraceContextCallback.runInInheritedContext(TraceContext.java: > 318) > at com.google.tracing.TraceContext > $TraceContextRunnable.run(TraceContext.java:446) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java: > 1110) > at java.util.concurrent.ThreadPoolExecutor > $Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:636) > > The class itself is not very useful yet, it just receives POST > requests (well, in this case GET, as I wanted to check what is the > cause, so I just duplicated doPost into doGet) and based on the > requests headers, it returns other headers. But then it fails > somewhere. Local app engine works without any problems. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
