1 Reply Latest reply on Jan 5, 2005 11:43 AM by Thomas Diesler

    JBossWS and custom exceptions

    Mohammad Rahin Newbie

      I would like to have my service end point to throw application specific exceptions. It seem to work to some extent. The problem is that Axis within JBoss wraps my custom exception with a MBean exception.

      Here is the segment of stack trace from the point where a custom exception is raised,

      11:18:59,608 ERROR [ServiceEndpointInterceptor] Error from service endpoint, pro
      cessing fault handler chain
      org.myorg.ws.app.ApplicationProcessingException: Error: Application Processing
      Failed.
       at org.myorg.ws.app.implementation.ApplicationServiceBean.process(ApplicationServiceBean.java:139)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
      
      


      and here is the segment of stack trace where Axis wraps the custom exception with a generic MBeanException,

      11:18:59,608 ERROR [ServerEngine] Server error: AxisFault
       faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
       faultSubcode:
       faultString: MBeanException: null Cause: org.myorg.ws.app.ApplicationProcessingException:
      Error: Application Processing Failed.
       faultActor:
       faultNode:
       faultDetail:
       {http://xml.apache.org/axis/}stackTrace: MBeanException: null Cause:
      org.myorg.ws.app.ApplicationProcessingException: Error: Application Processing Failed.
       at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptio
      ns(ReflectedDispatcher.java:166)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:149)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      
      


      and finally, the SOAP response message,

      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <soapenv:Fault>
       <faultcode>soapenv:Client</faultcode>
       <faultstring>MBeanException: null Cause: org.myorg.ws.app.ApplicationProcessingException: Error: Application Processing Failed.</faultstring>
       <detail/>
       </soapenv:Fault>
       </soapenv:Body>
      </soapenv:Envelope>
      


      Are custom exceptions supported without being wrapped by a generic exception in JBoss WS?