From issues-return-18826-apmail-struts-issues-archive=struts.apache.org@struts.apache.org Thu Oct 11 10:31:05 2012 Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 79FAFDE9C for ; Thu, 11 Oct 2012 10:31:05 +0000 (UTC) Received: (qmail 47055 invoked by uid 500); 11 Oct 2012 10:31:05 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 46972 invoked by uid 500); 11 Oct 2012 10:31:04 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 46910 invoked by uid 99); 11 Oct 2012 10:31:03 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Oct 2012 10:31:03 +0000 Date: Thu, 11 Oct 2012 10:31:03 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: <1009394275.25519.1349951463789.JavaMail.jiratomcat@arcas> In-Reply-To: <453193069.69792.1303302905741.JavaMail.tomcat@hel.zones.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) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-3609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474015#comment-13474015 ] Lukasz Lenart commented on WW-3609: ----------------------------------- Added more logging, checking the example action > 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