title: com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl cannot be cast to javax.xml.soap.MessageFactory
body: <p>I'm using WebLgic have the following saaj soap message factory.  I've tried leaving off the messageFactory and just the soapVersion and vice Versa.  I've also tried the different messageFactory Impl beans that are commented out.  I'm still getting the error in the title.  Why is t trying to use version 1.1?</p>
  
  <pre><code>&lt;bean id="saajMessageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory"&gt;
      &lt;property name="messageFactory"&gt;
          &lt;bean class="com.sun.xml.messaging.saaj.soap.MessageFactoryImpl" 
              /&gt; 
          &lt;!-- &lt;bean class="com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl" 
              /&gt; --&gt;
          &lt;!-- &lt;bean class="weblogic.xml.saaj.MessageFactoryImpl"/&gt; --&gt;
      &lt;/property&gt;
      &lt;property name="soapVersion"&gt;
          &lt;util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>SAAJ MessageFactory: Unable to create message factory for SOAP: com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl cannot be cast to javax.xml.soap.MessageFactory; nested exception is javax.xml.soap.SOAPException: Unable to create message factory for SOAP: com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl cannot be cast to javax.xml.soap.MessageFactory
              at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:188)
              at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:134)
              at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:219)
              at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:203)
              at org.springframework.ws.client.core.WebServiceTemplate.initMessageFactory(WebServiceTemplate.java:310)
  </code></pre>
  
  <p>pom file:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax&lt;/groupId&gt;
      &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;version&gt;7.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.xml.messaging.saaj&lt;/groupId&gt;
      &lt;artifactId&gt;saaj-impl&lt;/artifactId&gt;
      &lt;version&gt;1.3.15&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.xml.soap&lt;/groupId&gt;
      &lt;artifactId&gt;saaj-api&lt;/artifactId&gt;
      &lt;version&gt;1.3.5&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Weblogic.xml:</p>
  
  <pre><code>&lt;prefer-application-packages&gt;
      &lt;package-name&gt;javax.xml.soap.*&lt;/package-name&gt;
      &lt;package-name&gt;javax.xml.ws.*&lt;/package-name&gt;
      &lt;package-name&gt;com.sun.xml.messsaging.saaj.*&lt;/package-name&gt;
  &lt;/prefer-application-packages&gt; 
  </code></pre>
  
  <p>I should also add that I tried setting various this JVM argument with various options: <code>-Djavax.xml.soap.MessageFactory=weblogic.xml.saaj.MessageFactoryImpl</code>
  such as com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl.  The error message now reflects the new Impl class, but I still can't get around the error.</p>