struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3609) Struts problem report not working properly (Freemarker template error in error.ftl at line 68 in conjunction with special exception types)
Date Thu, 11 Oct 2012 11:03:03 GMT

    [ https://issues.apache.org/jira/browse/WW-3609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474034#comment-13474034
] 

Hudson commented on WW-3609:
----------------------------

Integrated in Struts2 #540 (See [https://builds.apache.org/job/Struts2/540/])
    WW-3609 adds more logging when exception occurred (Revision 1396976)

     Result = SUCCESS
lukaszlenart : 
Files : 
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java

                
> Struts problem report not working properly (Freemarker template error in error.ftl at
line 68 in conjunction with special exception types)
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3609
>                 URL: https://issues.apache.org/jira/browse/WW-3609
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>         Environment: Sun JDK 1.6
>            Reporter: Markus Kreusch
>            Priority: Minor
>             Fix For: 2.3.6
>
>         Attachments: freemarker-template-error.html, IndexAction.java
>
>
> I've a struts 2 application where the instantiation of an action leads to a org.hibernate.exception.GenericJDBCException.
This exception is "expected" (during development) and because development mode is enabled
it should lead to a "Struts Problem Report" page showing the exception details.
> The problem report page does not contain the full information of the exception but a
big yellow box titled "FreeMarker template error!" appears. Details inside the box are:
> Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int)
threw an exception when invoked on org.hibernate.exception.GenericJDBCException: could not
execute query
> The problematic instruction:
> ----------
> ==> ${msg[0]} [on line 68, column 29 in org/apache/struts2/dispatcher/error.ftl]
> freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int)
threw an exception when invoked on org.hibernate.exception.GenericJDBCException: could not
execute query
> 	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
> .... [part of the stack trace ommited]
> Caused by: java.lang.NullPointerException
> 	at freemarker.ext.beans.SimpleMemberModel.unwrapArguments(SimpleMemberModel.java:85)
> 	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:106)
> 	... 47 more
> I could determine the exact position of the NullPointerException by debugging the code.
I'm not sure why but the class SimpleMemberModel gets instantiated
> with the method org.hibernate.exception.NestableRuntimeException.getMessage(int) and
null for the argTypes array. This leads to the NullPointerException at line 85 (int typeLen
= argTypes.length;). Maybe struts is "confused" because the class org.hibernate.exception.NestableRuntimeException
contains two methods called getMessage one without and one with an int as parameter. I'll
try to create a minimal example to reproduce the behaviour as soon as possible.
> The main problem with this issue is that the stack trace of the former exception is swallowed,
not printed in the logfile or anywhere else. Please check and hopefully fix this it took some
hours to understand what the reason of this error is.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message