Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A5999F7C for ; Tue, 8 Nov 2011 05:31:21 +0000 (UTC) Received: (qmail 77955 invoked by uid 500); 8 Nov 2011 05:31:21 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 77846 invoked by uid 500); 8 Nov 2011 05:31:21 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 77810 invoked by uid 99); 8 Nov 2011 05:31:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 05:31:19 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2011 05:31:17 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id A41D23D640 for ; Tue, 8 Nov 2011 05:30:57 +0000 (UTC) Date: Tue, 8 Nov 2011 05:30:57 +0000 (UTC) From: "Freeman Fang (Closed) (JIRA)" To: issues@cxf.apache.org Message-ID: <518572566.9729.1320730257673.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <503389763.9969.1319483312292.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (CXF-3878) org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper does not print the WebApplicationException stack trace even when log level is set to FINEST 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/CXF-3878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Freeman Fang closed CXF-3878. ----------------------------- > org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper does not print the WebApplicationException stack trace even when log level is set to FINEST > --------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: CXF-3878 > URL: https://issues.apache.org/jira/browse/CXF-3878 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.3.7, 2.4.3 > Environment: Windows 7 64-bit, JDK 1.7.0 > Reporter: Kartik Pandya > Assignee: Daniel Kulp > Priority: Minor > Labels: log > Fix For: 2.3.8, 2.4.4 > > Original Estimate: 1h > Remaining Estimate: 1h > > WebApplicationException occurring as a result of a JAXB mapping (an internal NullPointerException caused it), never got printed on the console or in the logs. The following message did get printed: > WARNING WebApplicationException has been caught, cause: java.lang.NullPointerException > But beyond this, no other information was available. Debugging revealed that the problem was in JAXB mapping in one of my classes, but it would have been very helpful if the exception trace is printed in the logs or on the console. > The problem remained even after setting the log levels in logging.properties to FINEST. Other FINEST logs did get printed fine, except for the stack trace of the exception. My research showed that the setPrintStackTrace(boolean) method of WebApplicationExceptionMapper never gets called from anywhere. This will mean that the printStackTrace variable of the class always remains false, resulting in eternal shadowing of the stack trace. > I made a small change to my local copy of org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper Java file and patched it to cxf-2.4.3.jar to get the stack trace in my logs when log level was set to INFO or lower. The three line change is as below: > public Response toResponse(WebApplicationException ex) { > + if(LOG.isLoggable(Level.INFO)) { > + printStackTrace = true; > + } > ... > (lines with + are added lines) > It would be great if you can make this change in subsequent versions. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira