You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Peter Paul Bakker (JIRA)" <ji...@apache.org> on 2007/11/13 12:38:35 UTC

[jira] Created: (TILES-230) Missing error information when included jsp page has errors

Missing error information when included jsp page has errors
-----------------------------------------------------------

                 Key: TILES-230
                 URL: https://issues.apache.org/struts/browse/TILES-230
             Project: Tiles
          Issue Type: Bug
          Components: tiles-jsp (jsp support)
    Affects Versions: 2.0.5
         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
            Reporter: Peter Paul Bakker


When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.

We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.

The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.

>From the 2.0.5 code:

It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
 
    /**
     * Includes an URI in the JSP response.
     *
     * @param pageContext The page context to use.
     * @param uri The URI to include.
     * @param flush <code>true</code> means that the buffer should be flushed at
     * the end of this operation
     * @throws JspException If an underlying exception happens.
     */
    public static void doInclude(PageContext pageContext, String uri, boolean flush)
        throws JspException {

...

        try {
            pageContext.include(uri);
        } catch (IOException e) {
            throw new JspException("IOException while including page.", e);
        } catch (ServletException e) {
>>> line 102: throw new JspException("ServletException while including page.", e);
        }

    } 

Next stack frame:  JspTilesRequestContext 

    /** {@inheritDoc} */
    public void include(String path) throws IOException {
        try {
            JspUtil.doInclude(pageContext, path, false);
        } catch (JspException e) {
            LOG.error("JSPException while including path '" + path + "'. ", e);
            throw new IOException("JSPException while including path '" + path
                    + "'. " + e.getMessage());
        }
    }

Here, the JspException contains: 
+ cause: javax.servlet.jsp.JspException: ServletException while including page.
+ detailMessage: ServletException while including page.
+ rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s

The IOException contians:
+ cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
+ detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.

The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.

=============

Our quick fix is the following:

        try {
            pageContext.include(uri);
        } catch (IOException e) {
            throw new JspException("IOException while including page.", e);
        } catch (ServletException e) {
            // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
            throw new JspException("ServletException while including page: " + e.getMessage(), e);
        }



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli reassigned TILES-230:
--------------------------------------

    Assignee: Antonio Petrelli

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli reopened TILES-230:
------------------------------------


Unfortunately, the commit broke the compatibility with Java 5 (it works in Java 6) since IOException with String and Throwable is supported only in Java 6.

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core, tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>             Fix For: 2.0.6
>
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42649 ] 

Antonio Petrelli commented on TILES-230:
----------------------------------------

I agree with you, the exceptions must be fixed.
Anyway, reviewing the code I noticed that JspUtil in fact uses code that tries to connect to pre-2.0 JSP code, when the requirements of Tiles 2 is JSP 2.0
So I suppose that, at least, JspUtil can be completely removed.

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli closed TILES-230.
----------------------------------


Tiles 2.0.6 released.

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core, tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>             Fix For: 2.0.6
>
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli resolved TILES-230.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.6

Popped up exceptions when possible.

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core, tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>             Fix For: 2.0.6
>
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli updated TILES-230:
-----------------------------------

    Component/s: tiles-core

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core, tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TILES-230) Missing error information when included jsp page has errors

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli resolved TILES-230.
------------------------------------

    Resolution: Fixed

Now it should compile on Java 5.

> Missing error information when included jsp page has errors
> -----------------------------------------------------------
>
>                 Key: TILES-230
>                 URL: https://issues.apache.org/struts/browse/TILES-230
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core, tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: windows xp, IBM RAD 7, Websphere App Server 5.1
>            Reporter: Peter Paul Bakker
>            Assignee: Antonio Petrelli
>             Fix For: 2.0.6
>
>
> When an included jsp in a tile template contains errors, valuable context information from the original exception is lost and does not appear in the logging.
> We created a temp. fix by adding the relevant error information directly in the message of the exception. The original ServletException contains the information in the getMessage() and the internal rootCause member variable.
> The essential information is: "(7,0) No such tag textField in the tag library imported with prefix s", but this is lost.
> From the 2.0.5 code:
> It starts in JspUtil.doInclude(PageContext, String, boolean) line: 102	
>  
>     /**
>      * Includes an URI in the JSP response.
>      *
>      * @param pageContext The page context to use.
>      * @param uri The URI to include.
>      * @param flush <code>true</code> means that the buffer should be flushed at
>      * the end of this operation
>      * @throws JspException If an underlying exception happens.
>      */
>     public static void doInclude(PageContext pageContext, String uri, boolean flush)
>         throws JspException {
> ...
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
> >>> line 102: throw new JspException("ServletException while including page.", e);
>         }
>     } 
> Next stack frame:  JspTilesRequestContext 
>     /** {@inheritDoc} */
>     public void include(String path) throws IOException {
>         try {
>             JspUtil.doInclude(pageContext, path, false);
>         } catch (JspException e) {
>             LOG.error("JSPException while including path '" + path + "'. ", e);
>             throw new IOException("JSPException while including path '" + path
>                     + "'. " + e.getMessage());
>         }
>     }
> Here, the JspException contains: 
> + cause: javax.servlet.jsp.JspException: ServletException while including page.
> + detailMessage: ServletException while including page.
> + rootCause: javax.servlet.ServletException: /WEB-INF/starlight/workflow/addCustomerInformation.jsp(7,0) No such tag textField in the tag library imported with prefix s
> The IOException contians:
> + cause: java.io.IOException: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> + detailMessage: JSPException while including path '/WEB-INF/starlight/workflow/addCustomerInformation.jsp'. ServletException while including page.
> The essential info is lost in the IOException and is also not logged in the toString() method of the JSP exception.
> =============
> Our quick fix is the following:
>         try {
>             pageContext.include(uri);
>         } catch (IOException e) {
>             throw new JspException("IOException while including page.", e);
>         } catch (ServletException e) {
>             // added the getMessage, because the root cause gets lost when the JSPException bubbles up.
>             throw new JspException("ServletException while including page: " + e.getMessage(), e);
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.