I'm new to lift and I hope one of you guys could help me with this
little problem.
I just finished my first lift app and I get no exception when I start
jetty in dev mode but when I start getting the following exception
when jetty is started in production mode.
I don't understand why I'm getting this since I'm not using Comet (at
least that I know of)
LiftRules - Exception being returned to browser when processing
Req(List(F1135806610807OKRBFQ, _), Map(F1135806610807OKRBFQ ->
List(1135806610814), _ -> List(1319155726629)),
ParsePath(List(comet_request, 93859598055, sqigj8s96n5d1hxprpqvma53l,
F1135806610801VE4JLK),,true,false), , GetRequest, Empty)
java.lang.NullPointerException: null
at org.eclipse.jetty.server.Request.getServerName(Request.java:1008)
~[na:na]
at org.eclipse.jetty.server.Request.getServerPort(Request.java:1071)
~[na:na]
at net.liftweb.http.provider.servlet.HTTPRequestServlet.serverPort(HTTPRequestServlet.scala:92)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:968)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.Req$$anonfun$hostAndPath$1.apply(Req.scala:968)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.common.Full.map(Box.scala:491)
~[lift-common_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.Req.hostAndPath(Req.scala:968)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftSession$$anonfun$cometForHost$1.apply(LiftSession.scala:600)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftSession$$anonfun$cometForHost$1.apply(LiftSession.scala:599)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at scala.collection.TraversableLike$$anonfun$filter$1.apply(TraversableLike.scala:213)
~[scala-library-2.9.0-1.jar:na]
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
~[scala-library-2.9.0-1.jar:na]
at scala.collection.immutable.List.foreach(List.scala:45)
~[scala-library-2.9.0-1.jar:na]
at scala.collection.TraversableLike$class.filter(TraversableLike.scala:212)
~[scala-library-2.9.0-1.jar:na]
at scala.collection.immutable.List.filter(List.scala:45)
~[scala-library-2.9.0-1.jar:na]
at net.liftweb.http.LiftSession.cometForHost(LiftSession.scala:599)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftRules$$anonfun$7.apply(LiftRules.scala:292)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftRules$$anonfun$7.apply(LiftRules.scala:289)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftRules.net$liftweb$http$LiftRules$$_getLiftSession(LiftRules.scala:280)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftRules$$anonfun$5.apply(LiftRules.scala:237)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftRules$$anonfun$5.apply(LiftRules.scala:237)
~[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet.getLiftSession(LiftServlet.scala:75)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet.doService(LiftServlet.scala:270)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:128)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet$$anonfun$doIt$1$1.apply(LiftServlet.scala:127)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:344)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.TimeHelpers$class.logTime(TimeHelpers.scala:363)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.Helpers$.logTime(Helpers.scala:34)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet.doIt$1(LiftServlet.scala:127)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.LiftServlet.service(LiftServlet.scala:138)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply$mcV$sp(HTTPProvider.scala:69)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply(HTTPProvider.scala:68)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2$$anonfun$apply$mcV$sp$1.apply(HTTPProvider.scala:68)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.URLRewriter$.doWith(Req.scala:1234)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply$mcV$sp(HTTPProvider.scala:67)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply(HTTPProvider.scala:67)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.http.provider.HTTPProvider$$anonfun$service$2.apply(HTTPProvider.scala:67)
[lift-webkit_2.9.0-1-2.4-M3.jar:2.4-M3]
at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:71)
[lift-util_2.9.0-1-2.4-M3.jar:2.4-M3]
I appreciate any help,
Thanks in advance
Just a few questions to hopefully help here.
1- Do you start jetty both times (dev and production) from sbt or maven?
2- If when you get a NPE you are deploying the war file to your
container, can you try starting the container (jetty) in dev mode and
see if you get a NPE there?
3- Can you try to upgrade to Lift 2.4-M4 ?
Regards,
Diego
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
--
Diego Medina
Web Developer
di...@fmpwizard.com
http://www.fmpwizard.com
Thanks for you reply.
1 - Both times from maven
2 - I can see the NPE after deploying the war file to my container
(jetty 8). I get no NPE when I start it in dev mode.
3 - I think I'm running Lift 2.4-M3 but I'll double check it, and I'll
upgrade it if that's the case.
I'll let you know.
Thanks again.
Hi Diego,
Thanks for you reply.
1 - Both times from maven
2 - I can see the NPE after deploying the war file to my container
(jetty 8). I get no NPE when I start it in dev mode.
3 - I think I'm running Lift 2.4-M3 but I'll double check it, and I'll
upgrade it if that's the case.
On Tue, Oct 25, 2011 at 1:00 PM, Gilberto Garcia <giba...@gmail.com> wrote:
Hi Diego,
Thanks for you reply.
1 - Both times from maven
2 - I can see the NPE after deploying the war file to my container
(jetty 8). I get no NPE when I start it in dev mode.
3 - I think I'm running Lift 2.4-M3 but I'll double check it, and I'll
upgrade it if that's the case.This is a bug in Jetty... it's come up on the list from time to time. Please upgrade to Jetty 7 or 8.
I just updated lift to 2.4-M4 and now it's ok when running with maven.
but I'm still getting the NPE when I deploy the war file into the
container.
I'm starting jetty using jetty.sh file.
Thanks.
Thanks for your help.
As I said earlier, I'm running jetty 8 already.
After upgrading lift to 2.4-M4 the NPE is gone.
Thanks
Great!
Diego
Sent from my android cell
On Tue, Oct 25, 2011 at 1:00 PM, Gilberto Garcia <giba...@gmail.com> wrote:
Hi Diego,
Thanks for you reply.
1 - Both times from maven
2 - I can see the NPE after deploying the war file to my container
(jetty 8). I get no NPE when I start it in dev mode.
3 - I think I'm running Lift 2.4-M3 but I'll double check it, and I'll
upgrade it if that's the case.
This is a bug in Jetty... it's come up on the list from time to time. Please upgrade to Jetty 7 or 8.
-- Francois ARMAND http://fanf42.blogspot.com http://www.normation.com
Didn't try glassfish
cheers
I was getting NPE exceptions after migrating to jetty "8.0.4.v20111024" with Lift 2.4M4 and 2.4M5. Switched to "7.3.0.v20110203" and it's fine so far.
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
Ok, sorry for the wait. Blog post explaining things at http://shadowfiend.posterous.com/unexpected-nullpointerexceptions-in-lift-prod , ticket for improved error message is at https://www.assembla.com/spaces/liftweb/tickets/1165-improved-error-message-for-invocationtarget-nullpointerexceptions-related-to-terminated-requests .
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code