[jboss-user] [JBossWS] - Suppressing SoapFault Stack trace

zurchman do-not-reply at jboss.com
Tue Dec 12 17:13:44 EST 2006


It looks like this code in SOAPFaultExceptionHandler (1.0.4.GA) will always log an ugly stack trace for Exceptions thrown by the Endpoint.

Is there some way to supress the stack trace?

In many cases, the Exception is expected, and all we're really interested in logging at the Endpoint is the fault message.

 
  |  /** Translate the request exception into a SOAPFault message.
  |     */
  |    public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
  |    {
  |       // Get or create the SOAPFaultException
  |       SOAPFaultException faultEx;
  |       if (reqEx instanceof SOAPFaultException)
  |       {
  |          faultEx = (SOAPFaultException)reqEx;
  |       }
  |       else
  |       {
  |          QName faultCode = Constants.SOAP11_FAULT_CODE_CLIENT;
  |          String faultString = (reqEx.getMessage() != null ? reqEx.getMessage() : reqEx.toString());
  |          faultEx = new SOAPFaultException(faultCode, faultString, null, null);
  |          faultEx.initCause(reqEx);
  |       }
  |       
  |       Throwable faultCause = faultEx.getCause();
  |       log.error("SOAP request exception", faultCause != null ? faultCause : faultEx);
  | 
  |       ...
  |    }
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993187#3993187

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993187



More information about the jboss-user mailing list