Search code examples
javaweb-servicessoapspring-wsmtom

Mixing of XOP/MTOM and attachments is not allowed


Our application sends file attachment to a web service using SOAP. The service is running on Oracle Service Bus 11g. We are using Spring WS + SAAJ + MTOM on client to send the request.

The application works fine on local and tomcat server, however, when we move the application to weblogic 12c server (war deployed), we see the following error when we hit the service.

BEA-382120 Error: Mixing of XOP/MTOM and attachments is not allowed!

It seems when it is deployed on the WebLogic the message no longer has MTOM enabled.

========================

Some additional information that might be helpful:

Spring WS configuration, libs used: spring-ws-1.5.8.jar commons-httpclient-3.1.jar

Thanks in advance.


Solution

  • After more investigation, it seems that weblogic overrides some of the classes or somehow confuses the classpath. In our case it was Saaj implementation. We had to add the saaj-impl-1.3.20.jar into our class-path and it worked. We also upgraded to spring-ws 2.2.0 and set the mtom to enable on the marshaller from the xml file.

    You can also add this jar in your setDomainEnv.cmd file of your weblogic folder

    set EXT_PRE_CLASSPATH=%DOMAIN_HOME%\lib\saaj-impl-1.3.20.jar