https://issues.apache.org/bugzilla/show_bug.cgi?id=48358

--- Comment #17 from Isabel Drost <isa...@apache.org> 2011-01-28 10:18:07 EST 
---
Created an attachment (id=26571)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26571)
Trivial fix for NPE problem for problem clarification

After checking the changes made to the initial patch version I think I have
found the main reason why unloading currently does not work as expected:

In org.apache.jasper.servlet.JspServlet in line 385 you call
rctxt.addWrapper(...) which adds the jsp to the list of known jsps in the
runtime context. However, for each wrapper the pointer to the unloadHandle is
not updated before wrapper.service is called (same file, line 391).

In the org.apache.jasper.compilerJspRuntimeContext in "checkUnload" (which is
triggered periodically) you iterate over the list of jsps, calling
jsw.getUnloadHandle() in line 609. This method will return null, until
wrapper.service has been called. As a result the unload loop crashes with an
NPE in that case:

org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor 
processChildren
SCHWERWIEGEND: Exception invoking periodic operation:
java.lang.NullPointerException at
org.apache.jasper.util.FastRemovalDequeue$Entry.access$700(FastRemovalDequeue.java:250)
         at
org.apache.jasper.util.FastRemovalDequeue.remove(FastRemovalDequeue.java:173)
         at
org.apache.jasper.compiler.JspRuntimeContext.checkUnload(JspRuntimeContext.java:609)
         at
org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:360)
         at
org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapper.java:660)
         at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1393)
         at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403)
         at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403)
         at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403)
         at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1382)
         at java.lang.Thread.run(Thread.java:619)


The attached patch fixed the problem for us - however neither does it solve the
root cause of the issue, nor am I certain that it works in general (e.g. there
is another call to addWrapper in TagFileProcessor). Patch is merely for
clarification than for fixing the issue.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to