Google Groups

Re: NullPointerException in Jetty when using Comet


YoJimbo May 10, 2011 1:57 PM
Posted in group: Lift
Hi

I am not a Java or Scala developer, but I have seen this when
initially load testing ahead of our first release, using either the
jetty from ubuntu repos or the latest from the 6 series downloaded
from the jetty website. When this happened we were running Lift
release candidates of the 2.2 branch - we are now 2.3 stable.
At the time I also ran the same production code that was throwing this
error on tomcat7 and did not see any issues or exceptions thrown,
whilst running the same load tests.
So I can only assume this is a jetty issue.
After this, I moved from using jetty6 to using the hightide6 version
jetty (http://dist.codehaus.org/jetty/jetty-hightide-6.1/hightide-6.1H.
24.tgz), and I have not seen this issue again. That said, we have made
a number of other tweaks to our production settings (like we have
tripled the default actor thread pool limit) and moving Lift version.
Also I guess just do all the basics checks as well - double checking
the servers /etc/hosts is correctly configured, specify our jetty port
in our /etc/default/jetty and also that we have nginx as a reverse
proxy properly configured to pass requests to jetty... in-case
anything basic environmental on the box is bumping into an issue in
jetty.

Jp


On May 10, 1:16 pm, jori <j...@dimensiology.com> wrote:
> I am also seeing this issue reported in this thread:
>
> http://groups.google.com/group/liftweb/browse_thread/thread/5bd62ec23...
>
> INFO - Service request (GET) /comet_request/11229338523/bni3exhia1x3/
> F145452833030NZTITH returned 500, took 3 Milliseconds
> ERROR - Exception being returned to browser when processing /xml/edit/
> 1058: Message: java.lang.NullPointerException
>         org.mortbay.jetty.Request.getServerName(Request.java:1112)
>         org.mortbay.jetty.Request.getServerPort(Request.java:1169)
>
> net.liftweb.http.provider.servlet.HTTPRequestServlet.serverPort(HTTPRequest Servlet.scala:
> 92)
>         net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:
> 968)
>         net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:
> 968)
>         net.liftweb.common.Full.map(Box.scala:478)
>         net.liftweb.http.Req.hostAndPath(Req.scala:968)
>         net.liftweb.http.LiftSession$$anonfun$cometForHost
> $1.apply(LiftSession.scala:615)
>         net.liftweb.http.LiftSession$$anonfun$cometForHost
> $1.apply(LiftSession.scala:614)
>         scala.collection.TraversableLike$$anonfun$filter
> $1.apply(TraversableLike.scala:240)
> scala.collection.LinearSeqOptimized
> $class.foreach(LinearSeqOptimized.scala:61)
>         scala.collection.immutable.List.foreach(List.scala:45)
>         scala.collection.TraversableLike
> $class.filter(TraversableLike.scala:239)
>         scala.collection.immutable.List.filter(List.scala:45)
>         net.liftweb.http.LiftSession.cometForHost(LiftSession.scala:
> 614)
>         net.liftweb.http.LiftRules$$anonfun$6.apply(LiftRules.scala:
> 260)
>         net.liftweb.http.LiftRules$$anonfun$6.apply(LiftRules.scala:
> 257)
>         net.liftweb.http.LiftRules$class.net$liftweb$http$LiftRules$
> $_getLiftSession(LiftRules.scala:248)
>         net.liftweb.http.LiftRules$$anonfun$4.apply(LiftRules.scala:
> 205)
>         net.liftweb.http.LiftRules$$anonfun$4.apply(LiftRules.scala:
> 205)
>         net.liftweb.http.LiftServlet.getLiftSession(LiftServlet.scala:
> 69)
>         net.liftweb.http.LiftServlet.doService(LiftServlet.scala:258)
>         net.liftweb.http.LiftServlet$$anonfun$doIt
> $1$1.apply(LiftServlet.scala:122)
>         net.liftweb.http.LiftServlet$$anonfun$doIt
> $1$1.apply(LiftServlet.scala:121)
>         net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:
> 344)
>         net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
>         ...
>
> I'm using Lift 2.3, Scala 2.8.1, and Jetty 6.1.22.
>
> thank you