cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1081348 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: impl/WebApplicationExceptionMapper.java provider/JAXBElementProvider.java
Date Mon, 14 Mar 2011 12:23:56 GMT
Author: sergeyb
Date: Mon Mar 14 12:23:56 2011
New Revision: 1081348

URL: http://svn.apache.org/viewvc?rev=1081348&view=rev
Log:
Printing stack traces for anonymous Exceptions and adding a config option to  WebAplicationException
mapper to print the traces

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WebApplicationExceptionMapper.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WebApplicationExceptionMapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WebApplicationExceptionMapper.java?rev=1081348&r1=1081347&r2=1081348&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WebApplicationExceptionMapper.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/WebApplicationExceptionMapper.java
Mon Mar 14 12:23:56 2011
@@ -37,6 +37,8 @@ public class WebApplicationExceptionMapp
     private static final Logger LOG = LogUtils.getL7dLogger(WebApplicationExceptionMapper.class);
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(WebApplicationExceptionMapper.class);
     
+    private boolean printStackTrace;
+    
     public Response toResponse(WebApplicationException ex) {
         if (LOG.isLoggable(Level.WARNING)) {
             String message = ex.getCause() == null ? ex.getMessage() : ex.getCause().getMessage();
@@ -65,7 +67,17 @@ public class WebApplicationExceptionMapp
             }
             r = Response.status(500).type(MediaType.TEXT_PLAIN).entity(message).build();
         }
+        
+        if (printStackTrace) {
+            ex.printStackTrace();
+        }
+        
         return r;
     }
 
+    public void setPrintStackTrace(boolean printStackTrace) {
+        this.printStackTrace = printStackTrace;
+    }
+
+    
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java?rev=1081348&r1=1081347&r2=1081348&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JAXBElementProvider.java
Mon Mar 14 12:23:56 2011
@@ -175,6 +175,7 @@ public class JAXBElementProvider extends
         } catch (WebApplicationException e) {
             throw e;
         } catch (Exception e) {
+            e.printStackTrace();
             throw new WebApplicationException(e);        
         }
         // unreachable
@@ -248,6 +249,7 @@ public class JAXBElementProvider extends
         }  catch (WebApplicationException e) {
             throw e;
         } catch (Exception e) {
+            e.printStackTrace();
             throw new WebApplicationException(e);        
         }
     }



Mime
View raw message