[ jetty-Bugs-1279670 ] NPE on startup for short sesion timeouts

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ jetty-Bugs-1279670 ] NPE on startup for short sesion timeouts

SourceForge.net
Bugs item #1279670, was opened at 2005-09-01 16:31
Message generated for change (Comment added) made by gregwilkins
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1279670&group_id=7322

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Other
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Submitted By: Leif Mortenson (mortenson)
Assigned to: Nobody/Anonymous (nobody)
Summary: NPE on startup for short sesion timeouts

Initial Comment:
Using Jetty 4.2.24, if you set the session-timeout to
anything less than 5 minutes in the web.xml file you
will get the following NPE on server startup.  (I am
using Jetty embedded as a component, so this may or may
not happen with the standalone Jetty server, but I
think it should):
java.lang.NullPointerException
     at
org.mortbay.jetty.servlet.AbstractSessionManager.setScavengePeriod(AbstractSessionManager.java:279)
     at
org.mortbay.jetty.servlet.AbstractSessionManager.setMaxInactiveInterval(AbstractSessionManager.java:248)
     at
org.mortbay.jetty.servlet.ServletHandler.setSessionInactiveInterval(ServletHandler.java:496)
     at
org.mortbay.jetty.servlet.WebApplicationContext.initSessionConfig(WebApplicationContext.java:999)
     at
org.mortbay.jetty.servlet.WebApplicationContext.initWebXmlElement(WebApplicationContext.java:742)
     at
org.mortbay.jetty.servlet.WebApplicationContext.initialize(WebApplicationContext.java:705)
     at
org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:404)
     at
org.mortbay.http.HttpServer.start(HttpServer.java:663)
...

The problem is that
AbstractSessionManager.setScavengePeriod is being
called before the _sessions Map is being created.  That
map is only created when the
AbstractSessionManager.start() method is called.
Normally that works, but there is some code in
AbstractSessionManager.setMaxInactiveInterval which
calls setScavengePeriod early when the session-timeout
is short.

Is there any reason why the _sessions instance could
not just be created when the AbstractSessionManager
object is created?  Alternatively add some null tests
to the setScavengePeriod method.  But that seems to be
a bit of a hack.

Cheers,
Leif

----------------------------------------------------------------------

>Comment By: Greg Wilkins (gregwilkins)
Date: 2005-09-11 19:29

Message:
Logged In: YES
user_id=44062

This is fixed in Jetty 5 (sync is different).
We are  not planning on a new Jetty 4 release, but I
will put a NPE "hack" into CVS today :-)

thanks for the report


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107322&aid=1279670&group_id=7322


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
jetty-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jetty-discuss