Announcement Announcement Module
Collapse
No announcement yet.
Handling Exceptions From Aspects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling Exceptions From Aspects

    Hi There,

    I'm developing web services based on spring 3.1.1 and spring-ws 2.0. What I've is following
    1. Couple of endpoints exposing methods annotated with PayloadRoot/ReponseBody
    2. Have one aspect with an around advice which wraps around all endpoints and methods annotated with PayloadRoot. this aspect does couple of check on the incoming request and if something goes wrong throws an exception with some message

    What happens is when an exception is thrown from this aspect, I see the SoapFault as response as below
    Code:
       <SOAP-ENV:Body>
          <SOAP-ENV:Fault>
             <faultcode>SOAP-ENV:Server</faultcode>
             <faultstring xml:lang="en">java.lang.reflect.UndeclaredThrowableException</faultstring>
          </SOAP-ENV:Fault>
       </SOAP-ENV:Body>
    What I am expecting is to see the message thrown with the exception from Aspect as faultString. I also have exception resolver configure in my context with the exception mapping which is thrown from the aspect.

    I've no idea whats going wrong or if I'm missing any configuration. Any help in this regards is much appreciated.

    Regards,
    Jay
Working...
X