JBoss and CXF Exception When Receiving Message

Exception when receiving message: setProperty must be overridden by all subclasses of SOAPMessage

While my application worked correctly in Jetty, SOAPified messages were being reject by the same webapp in JBoss. It looked like JBoss was using the wrong class somehow.

From this mailing list entry, I found that I needed to added the following four files. Each has as content a single line:

File name Contents
META-INF/services/javax.xml.soap.MessageFactory com.sun.xml.messaging.saaj.soap.DynamicMessageFactoryImpl
META-INF/services/javax.xml.soap.MetaFactory com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl
META-INF/services/javax.xml.soap.SOAPFactory com.sun.xml.messaging.saaj.soap.SOAPFactoryImpl
META-INF/services/javax.xml.ws.spi.Provider org.apache.cxf.jaxws.spi.ProviderImpl

Deploying the WAR with these changes got rid of the exception.

As a side note, I got the files into my WAR by adding them to src/main/webapp in my project and Maven took care of the rest.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply