You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Graham <dg...@hotmail.com> on 2003/05/07 17:25:21 UTC
Re: Tiles question
The simplest solution may be to comment out all but one of the includes
until you find the page throwing the error.
David
>From: Jonathan Hodges <jo...@infinity-insurance.com>
>Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>To: struts-user@jakarta.apache.org
>Subject: Tiles question
>Date: Wed, 07 May 2003 10:30:07 -0500
>
>Hello,
>
>I was just wondering if I am the only one that seems to have trouble
>debugging jsp code under the tiles framework. For instance, there can
>be a NullPointerException in one of my five 'included' jsp pages that
>are inserted from my tiles template as in this partial stack trace:
>
>[ServletException in:/jsp/role/content.jsp] null'
>java.lang.NullPointerException at
>org.apache.jsp.content_jsp._jspService(content_jsp.java:221) at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
>va:204) at
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
>her.java:684) at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp
>atcher.java:575) at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat
>cher.java:498) at
>org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
>at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161) at
>org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
>at
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa
>g.java:818) at
>org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467) at
>org.apache.jsp.hscf_jsp._jspx_meth_tiles_insert_2(hscf_jsp.java:182) at
>org.apache.jsp.hscf_jsp._jspService(hscf_jsp.java:85) at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
>va:204) at
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
>her.java:684) at
>org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp
>atcher.java:432) at
>org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat
>cher.java:356) at
>
>.
>
>Because tiles uses custom tags to render the final display page, the
>line that caused the NullPointerException is sometimes obscured. By
>looking at the above stack trace, I could go check out the compiled jsp,
>content_jsp.java. However, line 221 reads as:
>
>if (pageContext != null) pageContext.handlePageException(t);
>
>in the catch block of:
>
> } catch (Throwable t) {
> out = _jspx_out;
> if (out != null && out.getBufferSize() != 0)
> out.clearBuffer();
> if (pageContext != null) pageContext.handlePageException(t);
> } finally {
> if (_jspxFactory != null)
>_jspxFactory.releasePageContext(pageContext);
> }
>
>Basically the whole page is inside a try/catch block so the error can be
>at almost any line. Is there something that I am missing for an easier
>way to locate the problem line? Any suggestions would be greatly
>appreciated.
>
>Thanks in advance,
>
>Jonathan Hodges
>Infinity Insurance Group
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Tiles question
Posted by Jonathan Hodges <jo...@infinity-insurance.com>.
David,
Thanks for your reply. Actually, it tells me the correct page, but even
in the same page it can be a decent number of lines of code to sift
through searching for the error. This NullPointerException is just the
latest example I have come across. Sometimes it is more difficult to
determine. I was just wondering if there is a best practice or
something that I have missed or something.
-Jonathan
-----Original Message-----
From: David Graham [mailto:dgraham1980@hotmail.com]
Sent: Wednesday, May 07, 2003 10:25 AM
To: struts-user@jakarta.apache.org
Subject: Re: Tiles question
The simplest solution may be to comment out all but one of the includes
until you find the page throwing the error.
David
>From: Jonathan Hodges <jo...@infinity-insurance.com>
>Reply-To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>To: struts-user@jakarta.apache.org
>Subject: Tiles question
>Date: Wed, 07 May 2003 10:30:07 -0500
>
>Hello,
>
>I was just wondering if I am the only one that seems to have trouble
>debugging jsp code under the tiles framework. For instance, there can
>be a NullPointerException in one of my five 'included' jsp pages that
>are inserted from my tiles template as in this partial stack trace:
>
>[ServletException in:/jsp/role/content.jsp] null'
>java.lang.NullPointerException at
>org.apache.jsp.content_jsp._jspService(content_jsp.java:221) at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
a
>va:204) at
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295
)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:684) at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
p
>atcher.java:575) at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
t
>cher.java:498) at
>org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:118)
>at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161) at
>org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
>at
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertT
a
>g.java:818) at
>org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
at
>org.apache.jsp.hscf_jsp._jspx_meth_tiles_insert_2(hscf_jsp.java:182) at
>org.apache.jsp.hscf_jsp._jspService(hscf_jsp.java:85) at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j
a
>va:204) at
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295
)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at
>javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:684) at
>org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
p
>atcher.java:432) at
>org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
t
>cher.java:356) at
>
>.
>
>Because tiles uses custom tags to render the final display page, the
>line that caused the NullPointerException is sometimes obscured. By
>looking at the above stack trace, I could go check out the compiled
jsp,
>content_jsp.java. However, line 221 reads as:
>
>if (pageContext != null) pageContext.handlePageException(t);
>
>in the catch block of:
>
> } catch (Throwable t) {
> out = _jspx_out;
> if (out != null && out.getBufferSize() != 0)
> out.clearBuffer();
> if (pageContext != null) pageContext.handlePageException(t);
> } finally {
> if (_jspxFactory != null)
>_jspxFactory.releasePageContext(pageContext);
> }
>
>Basically the whole page is inside a try/catch block so the error can
be
>at almost any line. Is there something that I am missing for an easier
>way to locate the problem line? Any suggestions would be greatly
>appreciated.
>
>Thanks in advance,
>
>Jonathan Hodges
>Infinity Insurance Group
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org