Crazy runtime error with stax.net

4 views
Skip to first unread message

Timothy Perrett

unread,
Jun 4, 2010, 5:04:04 AM6/4/10
to Lift
Hey all,

I keep getting this error when deploying my app to stax:
http://liftinaction.timperrett.staxapps.net/

java.lang.NullPointerException
net.liftweb.http.provider.HTTPProvider$$anonfun$service
$3.apply(HTTPProvider.scala:61)
net.liftweb.http.provider.HTTPProvider$$anonfun$service
$3.apply(HTTPProvider.scala:61)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.URLRewriter$.doWith(Req.scala:574)
net.liftweb.http.provider.HTTPProvider
$class.service(HTTPProvider.scala:60)
net.liftweb.http.LiftFilter.service(LiftServlet.scala:586)
net.liftweb.http.provider.servlet.ServletFilterProvider
$class.protected$service(ServletFilterProvider.scala:67)
net.liftweb.http.LiftFilter.protected$service(LiftServlet.scala:586)
net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:67)
net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1$$anonfun$apply$1.apply(ServletFilterProvider.scala:62)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10$$anonfun$apply$11.apply(Vars.scala:334)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10.apply(Vars.scala:333)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply
$9.apply(Vars.scala:332)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:331)
net.liftweb.http.RequestVarHandler$.apply(Vars.scala:250)
net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1.apply(ServletFilterProvider.scala:61)
net.liftweb.http.provider.servlet.ServletFilterProvider$$anonfun
$doFilter$1.apply(ServletFilterProvider.scala:61)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10$$anonfun$apply$11$$anonfun$apply$12.apply(Vars.scala:335)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10$$anonfun$apply$11.apply(Vars.scala:334)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply$9$$anonfun$apply
$10.apply(Vars.scala:333)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$$anonfun$apply
$9.apply(Vars.scala:332)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
net.liftweb.http.CoreRequestVarHandler$class.apply(Vars.scala:331)
net.liftweb.http.TransientRequestVarHandler$.apply(Vars.scala:254)
net.liftweb.http.provider.servlet.ServletFilterProvider
$class.doFilter(ServletFilterProvider.scala:60)
net.liftweb.http.LiftFilter.doFilter(LiftServlet.scala:586)


It seems to be breaking on the lift provider code, however, i have
other apps that run fine on stax so im unsure of the issue here.

Any ideas?

Cheers, Tim

Harry-Anton Talvik

unread,
Jun 4, 2010, 6:03:44 AM6/4/10
to lif...@googlegroups.com
Hey,

Sorry, no ideas how to fix.

Just mentioning that I have the same problem, and has occurred several
times (app compiled with 2.8.0.Beta1 from 2.0-SNAPSHOT some 2 weeks
ago). App just sits idle and results in a stack like yours:

---
HTTP ERROR 500

Problem accessing /. Reason:

INTERNAL_SERVER_ERROR

Caused by:

java.lang.NullPointerException
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:574)
at net.liftweb.http.provider.HTTPProvider$class.service(HTTPProvider.scala:60)
at net.liftweb.http.LiftFilter.service(LiftServlet.scala:572)
at net.liftweb.http.provider.servlet.ServletFilterProvider$class.protected$service(ServletFilterProvider.scala:67)
at net.liftweb.http.LiftFilter.protected$service(LiftServlet.scala:572)
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:572)
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.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.handler.rewrite.RewriteHandler.handle(RewriteHandler.java:230)
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.HttpParser.parseNext(HttpParser.java:547)
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:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Powered by Jetty://
---

I'm using
SiteMap.rawIndex_? = true
on Jetty 6.1.22 (with jdk1.6.0_18), thought once that this might be
the reason 'cause there were warnings in documentation/somewhere that
it might not work with all containers. Have not got around to test the
situation with basic Lift app, yet.

I would be interested from any possible solutions, too.

Cheers,
-ha

On Fri, Jun 4, 2010 at 12:04, Timothy Perrett <tim...@getintheloop.eu> wrote:
> I keep getting this error when deploying my app to stax:
> http://liftinaction.timperrett.staxapps.net/
>
> java.lang.NullPointerException
>        net.liftweb.http.provider.HTTPProvider$$anonfun$service
> $3.apply(HTTPProvider.scala:61)
>        net.liftweb.http.provider.HTTPProvider$$anonfun$service
> $3.apply(HTTPProvider.scala:61)
>        net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
>        net.liftweb.http.URLRewriter$.doWith(Req.scala:574)
>        net.liftweb.http.provider.HTTPProvider
> $class.service(HTTPProvider.scala:60)
>        net.liftweb.http.LiftFilter.service(LiftServlet.scala:586)
>        net.liftweb.http.provider.servlet.ServletFilterProvider

> It seems to be breaking on the lift provider code, however, i have

Marius

unread,
Jun 4, 2010, 7:07:42 AM6/4/10
to Lift
Hmmm ... looking at the stacktrace looks like it occurs when invoking
the 'chain' call-by-name is null but I don't see how that could ever
be since from ServletFilterProvider we always specify it:

service(httpRequest, httpResponse) {
chain.doFilter(req, res) // chain is here FilterChain
}


Marius

Marius

unread,
Jun 4, 2010, 7:18:09 AM6/4/10
to Lift
Actually line 61 is:

if (!(isLiftRequest_?(newReq) && actualServlet.service(newReq, resp)))

I wonder it the filter descroy method has been called and they still
try to serve the request. That is if the destroy was called the
actualServlet become null and explains the stack trace. Tim out of
curiosity in HTTP{Provider instead of:

protected def terminate {
if (actualServlet != null) {
actualServlet.destroy
actualServlet = null
}
}

can you try tu use just

protected def terminate {
actualServlet.destroy
}

can you try it out in stax env ?

Marius

unread,
Jun 4, 2010, 8:18:04 AM6/4/10
to Lift
Also throwing an exception from boot causes actualServlet to not be
instantiated. Not sure if this is the case here though.

Timothy Perrett

unread,
Jun 4, 2010, 12:07:21 PM6/4/10
to Lift
Ahh you were correct. It was throwing an error during boot because the
JNDI config was slightly wrong. Strange error though... i wonder if we
could do something to make it more intuitive?

Cheers, Tim

Marius

unread,
Jun 4, 2010, 12:09:54 PM6/4/10
to Lift
Well if boot throws an Exception we do log it, and that should be in
the logs. However if boot is throwing an exception probably part of
the application is compromised. But please open a defect and assign it
to me.
Reply all
Reply to author
Forward
0 new messages