title: javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: Fault code QName must be namespace qualified! when deploying in weblogic server 12c
body: <p>When I am deploying a struts2 project from tomcat to weblogic server 12c, I am getting below exception when i am connecting to an esb thru soapHandler stub.</p>
  
  <p>The soapHandler is getting proper fault envelope from esb.But after that it is showing below Exception:</p>
  
  <pre><code>javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: Fault code QName '2104' must be namespace qualified!
      at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:195)
      at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:128)
      at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
      at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:205)
      at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:292)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
      at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
      at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
      at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
      at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
      at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
      at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
      at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:510)
      at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
      at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3654)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3620)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
      at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
      at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2423)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2280)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2258)
      at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1626)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1586)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
      at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
      at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
      at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
      at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
      at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:617)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:397)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
  Caused By: javax.xml.soap.SOAPException: Fault code QName '2104' must be namespace qualified!
      at oracle.j2ee.ws.saaj.soap.soap11.Fault11.setFaultCode(Fault11.java:334)
      at oracle.j2ee.ws.saaj.soap.soap11.SOAPFactory11.createFault(SOAPFactory11.java:51)
      at oracle.j2ee.ws.saaj.soap.SOAPFactoryImpl.createFault(SOAPFactoryImpl.java:117)
      at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:184)
      at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:128)
      at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
      at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:205)
      at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:292)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
      at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
      at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
  </code></pre>
  
  <p>The fault message I am getting from esb is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;SOAP-ENV:Header&gt;
        &lt;wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1"&gt;
           &lt;wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-2433"&gt;
              &lt;wsu:Created&gt;2016-08-29T12:20:48.317Z&lt;/wsu:Created&gt;
              &lt;wsu:Expires&gt;2016-08-29T12:25:48.317Z&lt;/wsu:Expires&gt;
           &lt;/wsu:Timestamp&gt;
        &lt;/wsse:Security&gt;
     &lt;/SOAP-ENV:Header&gt;
     &lt;S:Body&gt;
        &lt;S:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"&gt;
           &lt;faultcode&gt;2104&lt;/faultcode&gt;
           &lt;faultstring&gt;Device Id is required&lt;/faultstring&gt;
        &lt;/S:Fault&gt;
     &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>The real issue was </p>
  
  <p>previously I was using com.sun.xml.messaging.saaj.soap but when I am using weblogic it is using (its own jar ) oracle.j2ee.ws.saaj.soap.soap11.</p>
  
  <p>I have tried below methods to solve But Couldnt able to</p>
  
  <ol>
  <li><p>inside weblogic.xml I have provided below lines</p>
  
  <pre><code> &lt;wls:prefer-application-packages&gt;
      &lt;wls:package-name&gt;com.sun.xml.messaging.saaj.*&lt;/wls:package-name&gt;
      &lt;wls:package-name&gt;com.sun.xml.ws.api.wsdl.parser.*&lt;/wls:package-name&gt;
           &lt;wls:package-name&gt;javax.xml.ws.soap.*&lt;/wls:package-name&gt;
      &lt;/wls:prefer-application-packages&gt;
      &lt;wls:prefer-application-resources&gt;
      &lt;wls:resource-name&gt;META-INF/services/javax.xml.ws.*    &lt;/wls:resource-name&gt; 
  &lt;wls:resource-name&gt;META-INF/services/com.sun.xml.ws.*&lt;/wls:resource-name&gt; 
  &lt;wls:resource-name&gt;META-INF/services/com.sun.tools.ws.*    &lt;/wls:resource-name&gt;
      &lt;/wls:prefer-application-resources&gt;
  &lt;/wls:container-descriptor&gt;
  </code></pre></li>
  </ol>
  
  <p>2.loged to admin console of weblogic . "Servers > Managed Server Name (link) > Server Start (tab) > Arguments: (box)"
  I have given</p>
  
  <pre><code>   JAVA_OPTIONS="-Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"
  </code></pre>
  
  <p>3.In the startWeblogic.sh file I have given</p>
  
  <pre><code>if "%WLS_REDIRECT_LOG%"=="" (
      echo Starting WLS with line:
      echo %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
      %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl -Dweblogic.Name=%SERVER_NAME% -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%
  ) else (
      echo Redirecting output from WLS window to %WLS_REDIRECT_LOG%
      %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% -Dweblogic.Name=%SERVER_NAME% -Djavax.xml.soap.MessageFactory=com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl -Djava.security.policy=%WLS_POLICY_FILE% %JAVA_OPTIONS% %PROXY_SETTINGS% %SERVER_CLASS%  &gt;"%WLS_REDIRECT_LOG%" 2&gt;&amp;1 
  )
  </code></pre>