elsten software
unread,Jan 5, 2011, 12:14:27 PM1/5/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
Hi all, I'm trying to track down a hard-to-reproduce bug which appears
to occur a little while after using my Lift-based application.
I've experienced this exception just once and a customer has also
experienced it several times. Here's the stack trace (apologies for
the length of the trace but I'm not sure how long is long enough):
HTTP ERROR 500
Problem accessing /index.html. Reason:
INTERNAL_SERVER_ERROR
Caused by:
java.lang.NullPointerException
at org.mortbay.jetty.Request.getServerName(Request.java:1113)
at org.mortbay.jetty.Request.getServerPort(Request.java:1170)
at
net.liftweb.http.provider.servlet.HTTPRequestServlet.serverPort(HTTPRequestServlet.scala:
88)
at net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:
397)
at net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:
397)
at net.liftweb.common.Full.map(Box.scala:398)
at net.liftweb.http.Req.hostAndPath(Req.scala:397)
at net.liftweb.http.LiftSession$$anonfun$cometForHost
$1.apply(LiftSession.scala:344)
at net.liftweb.http.LiftSession$$anonfun$cometForHost
$1.apply(LiftSession.scala:343)
at scala.List.filter(List.scala:859)
at net.liftweb.http.LiftSession.cometForHost(LiftSession.scala:
343)
at net.liftweb.http.LiftRules$$anonfun$10.apply(LiftRules.scala:
173)
at net.liftweb.http.LiftRules$$anonfun$10.apply(LiftRules.scala:
170)
at net.liftweb.http.LiftRules$.net$liftweb$http$LiftRules$
$_getLiftSession(LiftRules.scala:161)
at net.liftweb.http.LiftRules$$anonfun$8.apply(LiftRules.scala:
120)
at net.liftweb.http.LiftRules$$anonfun$8.apply(LiftRules.scala:
120)
at net.liftweb.http.LiftServlet.getLiftSession(LiftServlet.scala:
76)
at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:186)
at net.liftweb.http.LiftServlet$$anonfun$doIt
$1$1.apply(LiftServlet.scala:86)
at net.liftweb.http.LiftServlet$$anonfun$doIt
$1$1.apply(LiftServlet.scala:86)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:
326)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
at net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:
335)
at net.liftweb.util.Helpers$.logTime(Helpers.scala:34)
at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:85)
at net.liftweb.http.LiftServlet.service(LiftServlet.scala:96)
at net.liftweb.http.provider.HTTPProvider$$anonfun$service
$3.apply(HTTPProvider.scala:61)
at net.liftweb.http.provider.HTTPProvider$$anonfun$service
$3.apply(HTTPProvider.scala:61)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.URLRewriter$.doWith(Req.scala:618)
at net.liftweb.http.provider.HTTPProvider
$class.service(HTTPProvider.scala:60)
at net.liftweb.http.LiftFilter.service(LiftServlet.scala:586)
at net.liftweb.http.provider.servlet.ServletFilterProvider
$class.protected$service(ServletFilterProvider.scala:67)
at net.liftweb.http.LiftFilter.protected$service(LiftServlet.scala:
586)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:67)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:62)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10$$anonfun$apply$11.apply(Vars.scala:334)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10.apply(Vars.scala:333)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply
$9.apply(Vars.scala:332)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:
331)
at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:250)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1.apply(ServletFilterProvider.scala:61)
at net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1.apply(ServletFilterProvider.scala:61)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10$$anonfun$apply$11.apply(Vars.scala:334)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun
$apply$10.apply(Vars.scala:333)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$$anonfun$apply
$9.apply(Vars.scala:332)
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
at net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:
331)
at net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:
254)
at net.liftweb.http.provider.servlet.ServletFilterProvider
$class.doFilter(ServletFilterProvider.scala:60)
at net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:586)
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:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:
212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:
404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
410)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
It's happened on two separate pages of my app, although both share the
same comet actor. I assume it's related to comet due to the mention of
comet in the stack trace.
It appears to occur after a while of having the application running.
It has definitely occurred on page load, and I think it may also have
occurred as a result of a XHR call.
The NPE is caused when a member of jetty.Request, _uri, is referenced
in getServerName(). It looks like _uri is nullified by the recycle()
method, which is called from jetty.HttpConnection when the request/
response is complete (however, could continuations be affecting
this?). There is also a setter for _uri, but it appears this isn't
being called from a quick code review.
I haven't asked on the Jetty lists yet, which might be sensible, I
guess I wanted to move down the app stack gradually to understand what
Lift is doing with the jetty.Request at this point and see if anyone
else had experienced this. I could try to upgrade Lift and Jetty
versions but as I cannot reproduce I cannot be sure of whether doing
so has fixed the bug. I wanted to see if anyone had seen anything
similar or had any experience in this area.
Thanks!