You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Keszthelyi Laszlo <la...@diepresse.com> on 2012/12/07 14:37:18 UTC
Tomcat 7: JSP unloading - NullPointerException
Hi,
since Tomcat 7.0.30 (currently using version 7.0.33) I'm faced with the
following NullPointerException:
Dec 7, 2012 2:10:28 PM
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
processChildren
SEVERE: Exception invoking periodic operation:
java.lang.NullPointerException
at
org.apache.jasper.util.FastRemovalDequeue$Entry.access$700(FastRemovalDe
queue.java:254)
at
org.apache.jasper.util.FastRemovalDequeue.remove(FastRemovalDequeue.java
:177)
at
org.apache.jasper.compiler.JspRuntimeContext.checkUnload(JspRuntimeConte
xt.java:610)
at
org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:360)
at
org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapp
er.java:709)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1530)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1540)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1540)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1540)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:662)
I was able to debug and trace the exception and found that the Excpetion
is caused by a '.tag', I'm including in my JSP, which has no
UnloadHandle assigned when processed in
org.apache.jasper.compiler.JspRuntimeContext.checkUnload() line 610:
jspQueue.remove(jsw.getUnloadHandle());
Because jsw.getUnloadHandle() returns null, jspQueue.remove() fails and
is throwing the NullPointerException everytime, aborting the "unload".
Does anyone have an idea how to solve this problem or is there already a
fix?
Pls help me out.
Thanks.
Laszlo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: AW: Tomcat 7: JSP unloading - NullPointerException
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Laszlo,
On 12/7/12 10:58 AM, Keszthelyi Laszlo wrote:
> It looks like the exception appears only when "maxLoadedJsps" and "
> jspIdleTimeout" are set to a value >0 in tomcat/conf/web.xml and
> ".tag" files are used with jsp- scriptlets.
Thanks for the research. If you haven't already, please file this in
bugzilla with all the detail you have already provided here.
https://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%207
Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/
iEYEAREIAAYFAlDCITsACgkQ9CaO5/Lv0PDT2gCdE5lXMArsLWvQxIu1EWfeWj3z
UCEAoL9G55OMXL6MwD6129nwAfe3kcbD
=qQum
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
AW: Tomcat 7: JSP unloading - NullPointerException
Posted by Keszthelyi Laszlo <la...@diepresse.com>.
It looks like the exception appears only when "maxLoadedJsps" and " jspIdleTimeout" are set to a value >0 in tomcat/conf/web.xml and ".tag" files are used with jsp- scriptlets.
Web.xml changes:
<init-param>
<param-name>maxLoadedJsps</param-name>
<param-value>1000</param-value>
</init-param>
<init-param>
<param-name>jspIdleTimeout</param-name>
<param-value>5</param-value>
</init-param>
The exception can be observed in the example "Tag Files" -> "Display Products Example" but you have to edit the WEB-INF/tags/displayProducts.tag and append the following example scriptlet:
<%
String test = "this is =";
if (normalPrice != null)
test = test + normalPrice + " something";
else
test = test + onSale + "=";
StringBuilder tags=new StringBuilder(test);
tags.append(".").append(test).append("..."); // change here
test = tags.toString();
request.setAttribute("test", test);
%>
<%=test %>
Start Tomcat and invoke the example jsp http://localhost:8080/examples/jsp/jsp2/tagfiles/products.jsp
Wait and observe the catalina.out (or tomcat output) for exceptions. Normaly the exception won't appear. Now edit the previously added scriplet in WEB-INF/tags/displayProducts.tag modifying any string in one of the append statements.
Call the example jsp again, tomcat should recompile the tag, wait and observe again your tomcat output.
Do not shutdown or restart tomcat between these steps! Tomcat should recompile the tag on the fly.
We were able to reproduce the exception on Tomcat 7.0.30, 7.0.32 and 7.0.33 on different machines using the described steps.
Best regads
Laszlo
-----Ursprüngliche Nachricht-----
Von: Keszthelyi Laszlo [mailto:laszlo.keszthelyi@diepresse.com]
Gesendet: Freitag, 07. Dezember 2012 15:10
An: Tomcat Users List
Betreff: AW: Tomcat 7: JSP unloading - NullPointerException
Thank you for your fast reply, i will try to reproduce the problem with the example tag-files. Otherwise i will prepare a small web app to reproduce the bug and post it.
Best regards,
Laszlo
-----Ursprüngliche Nachricht-----
Von: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
Gesendet: Freitag, 07. Dezember 2012 14:49
An: Tomcat Users List
Betreff: Re: Tomcat 7: JSP unloading - NullPointerException
2012/12/7 Keszthelyi Laszlo <la...@diepresse.com>:
>
> since Tomcat 7.0.30 (currently using version 7.0.33) I'm faced with the
> following NullPointerException:
>
> Dec 7, 2012 2:10:28 PM
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
> processChildren
> SEVERE: Exception invoking periodic operation:
> java.lang.NullPointerException
> at
> org.apache.jasper.util.FastRemovalDequeue$Entry.access$700(FastRemovalDe
> queue.java:254)
> at
> org.apache.jasper.util.FastRemovalDequeue.remove(FastRemovalDequeue.java
> :177)
> at
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload(JspRuntimeConte
> xt.java:610)
> at
> org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:360)
> at
> org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapp
> er.java:709)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1530)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
> ContainerBase.java:1519)
> at java.lang.Thread.run(Thread.java:662)
>
> I was able to debug and trace the exception and found that the Excpetion
> is caused by a '.tag', I'm including in my JSP, which has no
> UnloadHandle assigned when processed in
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload() line 610:
> jspQueue.remove(jsw.getUnloadHandle());
>
> Because jsw.getUnloadHandle() returns null, jspQueue.remove() fails and
> is throwing the NullPointerException everytime, aborting the "unload".
>
> Does anyone have an idea how to solve this problem or is there already a
> fix?
>
Steps to reproduce = ?
Can you prepare a sample simple web application that demonstrates the
bug and file it into Bugzilla?
(Maybe it can be observed with the examples webapp? There are several
tags there.)
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
AW: Tomcat 7: JSP unloading - NullPointerException
Posted by Keszthelyi Laszlo <la...@diepresse.com>.
Thank you for your fast reply, i will try to reproduce the problem with the example tag-files. Otherwise i will prepare a small web app to reproduce the bug and post it.
Best regards,
Laszlo
-----Ursprüngliche Nachricht-----
Von: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
Gesendet: Freitag, 07. Dezember 2012 14:49
An: Tomcat Users List
Betreff: Re: Tomcat 7: JSP unloading - NullPointerException
2012/12/7 Keszthelyi Laszlo <la...@diepresse.com>:
>
> since Tomcat 7.0.30 (currently using version 7.0.33) I'm faced with the
> following NullPointerException:
>
> Dec 7, 2012 2:10:28 PM
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
> processChildren
> SEVERE: Exception invoking periodic operation:
> java.lang.NullPointerException
> at
> org.apache.jasper.util.FastRemovalDequeue$Entry.access$700(FastRemovalDe
> queue.java:254)
> at
> org.apache.jasper.util.FastRemovalDequeue.remove(FastRemovalDequeue.java
> :177)
> at
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload(JspRuntimeConte
> xt.java:610)
> at
> org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:360)
> at
> org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapp
> er.java:709)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1530)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
> ContainerBase.java:1519)
> at java.lang.Thread.run(Thread.java:662)
>
> I was able to debug and trace the exception and found that the Excpetion
> is caused by a '.tag', I'm including in my JSP, which has no
> UnloadHandle assigned when processed in
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload() line 610:
> jspQueue.remove(jsw.getUnloadHandle());
>
> Because jsw.getUnloadHandle() returns null, jspQueue.remove() fails and
> is throwing the NullPointerException everytime, aborting the "unload".
>
> Does anyone have an idea how to solve this problem or is there already a
> fix?
>
Steps to reproduce = ?
Can you prepare a sample simple web application that demonstrates the
bug and file it into Bugzilla?
(Maybe it can be observed with the examples webapp? There are several
tags there.)
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat 7: JSP unloading - NullPointerException
Posted by Konstantin Kolinko <kn...@gmail.com>.
2012/12/7 Keszthelyi Laszlo <la...@diepresse.com>:
>
> since Tomcat 7.0.30 (currently using version 7.0.33) I'm faced with the
> following NullPointerException:
>
> Dec 7, 2012 2:10:28 PM
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor
> processChildren
> SEVERE: Exception invoking periodic operation:
> java.lang.NullPointerException
> at
> org.apache.jasper.util.FastRemovalDequeue$Entry.access$700(FastRemovalDe
> queue.java:254)
> at
> org.apache.jasper.util.FastRemovalDequeue.remove(FastRemovalDequeue.java
> :177)
> at
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload(JspRuntimeConte
> xt.java:610)
> at
> org.apache.jasper.servlet.JspServlet.periodicEvent(JspServlet.java:360)
> at
> org.apache.catalina.core.StandardWrapper.backgroundProcess(StandardWrapp
> er.java:709)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1530)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
> essChildren(ContainerBase.java:1540)
> at
> org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
> ContainerBase.java:1519)
> at java.lang.Thread.run(Thread.java:662)
>
> I was able to debug and trace the exception and found that the Excpetion
> is caused by a '.tag', I'm including in my JSP, which has no
> UnloadHandle assigned when processed in
> org.apache.jasper.compiler.JspRuntimeContext.checkUnload() line 610:
> jspQueue.remove(jsw.getUnloadHandle());
>
> Because jsw.getUnloadHandle() returns null, jspQueue.remove() fails and
> is throwing the NullPointerException everytime, aborting the "unload".
>
> Does anyone have an idea how to solve this problem or is there already a
> fix?
>
Steps to reproduce = ?
Can you prepare a sample simple web application that demonstrates the
bug and file it into Bugzilla?
(Maybe it can be observed with the examples webapp? There are several
tags there.)
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org