[nanocontainer-scm] [jira] Created: (NANO-109) Occasional NullPointerException in ServletContainerListener
jira-yCVjj/[email protected] Wed, 24 Nov 2004 01:48:11 -0500 (EST)
| Newsgroups | gmane.comp.java.nanocontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/NANO-109
Here is an overview of the issue:
---------------------------------------------------------------------
Key: NANO-109
Summary: Occasional NullPointerException in ServletContainerListener
Type: Bug
Status: Unassigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NanoContainer
Components:
nanowar
Versions:
1.0-beta-3
Assignee:
Reporter: Jacob Kjome
Created: Wed, 24 Nov 2004 1:46 AM
Updated: Wed, 24 Nov 2004 1:46 AM
Environment: WinXP running with j2sdk1.4.2_06 and Tomcat-5.5.4
Description:
I'm not sure I've pineed down exactly why this happens, but I've found the following in my logs a couple times...
WARN [talina]]]: org.apache.catalina.core.ContainerBase 68953 - Exception processing manager org.apache.catalina.session.StandardManager@1e4853f background process
java.lang.NullPointerException
at org.nanocontainer.nanowar.ServletContainerListener.killContainer(ServletContainerListener.java:201)
at org.nanocontainer.nanowar.ServletContainerListener.access$100(ServletContainerListener.java:66)
at org.nanocontainer.nanowar.ServletContainerListener$1.valueUnbound(ServletContainerListener.java:173)
at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1586)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:718)
at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:558)
at org.apache.catalina.session.StandardManager.processExpires(StandardManager.java:813)
at org.apache.catalina.session.StandardManager.backgroundProcess(StandardManager.java:826)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1272)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1553)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1562)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1562)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1542)
at java.lang.Thread.run(Thread.java:534)
INFO [Thread-1]: org.apache.coyote.http11.Http11Protocol 124969 - Pausing Coyote HTTP/1.1 on http-8080
INFO [Thread-1]: rg.apache.catalina.core.StandardService 125984 - Stopping service Catalina
INFO [Thread-1]: org.apache.coyote.http11.Http11Protocol 126047 - Stopping Coyote HTTP/1.1 on http-8080
It seems that there are cases when Tomcat calls valueUnbound() on the container killer helper, but our transient reference to the container killer is already null. The fix is one of two possibilities...
1. Get rid of the transient containerKiller in SerlvetContainerListener and simply create a "new DefaultLifecycleContainerBuilder(null)" inside killContainer() each time it is called.
2. Check for a null containerKiller in killContainer() and avoid calling containerKiller.killContainer() if it is null.
I think the first one is most appropriate since it guarantees cleanup of the containers. Plus it gets rid of the only instance variable in ServletContainerListener. I think in a previous design, it needed to be there, but since the killer helper stuff made it in there, it really hasn't been necessary.
Jake
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira