cxfjboss7.xjbossws

JBossWS & Stateless WebServices, OutFaultInterceptor being ignored


We are tying to use a WebService OutFaultInterceptor as per this blog post and it doesn't seem to work in JBoss 7.x.

The problem is simple in that it just ignores the @OutFaultInterceptor annotation. I tested this by putting in a erroneous interceptor name and it didn't error out. Logging within the interceptor is simply not called (when the interceptor name is correct).

I have also tried using the WEB-INF/jboss-webservices.xml to define out interceptors but that also seems to get ignored.

Removing the @Stateless annotation also does not seem to help.

This was working fine on JBoss 5.1 but simply seems to not work on JBoss 7.x. What am I missing here?

Is there an alternative way to "translate" exceptions into soap faults?


Solution

  • In order for using Apache CXF APIs and implementation classes you need to add a dependency to the org.apache.cxf (API) module and / or org.apache.cxf.impl (implementation) module.

    Dependencies: org.apache.cxf services
    

    According documentation:

    When using annotations on your endpoints / handlers such as the Apache CXF ones (@InInterceptor, @GZIP, ...) remember to add the proper module dependency in your manifest. Otherwise your annotations are not picked up and added to the annotation index by JBoss Application Server 7, resulting in them being completely and silently ignored

    See also: JBoss Modules

    I hope this help.