title: JaxWsDynamicClientfactory + java.lang.RuntimeException: Cannot create a secure XMLInputFactory
body: <p>My CXF JaxWs Endpoint is hosted on a weblogic through a war. I'm trying to access an operation from a Stand-alone JaxWsDynamicClient. The Client is getting created but the following exception is thrown while trying o access the operation.</p>
  
  <p>I've pasted the Server Side and Client Side Exception, SEI, client code and the respective Service and Client pom(s). Didn't find any luck researching over this issue, mostly there seems to be no answer.</p>
  
  <h1>Server Exception</h1>
  
  <pre><code>java.lang.RuntimeException: Cannot create a secure XMLInputFactory
      at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:314) ~[cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:264) ~[cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1443) ~[cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:123) ~[cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [javax.servlet_1.0.0.0_2-5.jar:2.5]
      at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) [cxf-rt-transports-http-3.0.0.jar:3.0.0]
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696) [weblogic.jar:10.3.6.0]
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [com.bea.core.weblogic.security.identity_1.2.0.0.jar:1.2.0.0]
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.bea.core.weblogic.security.wls_1.0.0.0_6-2-0-0.jar:6.2.0.0]
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) [weblogic.jar:10.3.6.0]
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490) [weblogic.jar:10.3.6.0]
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) [com.bea.core.weblogic.workmanager_1.11.0.0.jar:1.11.0.0]
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) [com.bea.core.weblogic.workmanager_1.11.0.0.jar:1.11.0.0]
  </code></pre>
  
  <h1>Client exception</h1>
  
  <pre><code>org.apache.cxf.binding.soap.SoapFault: Cannot create a secure XMLInputFactory
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84)
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51)
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
      at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113)
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1636)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279)
      at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:314)
      at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(ClientImpl.java:305)
      at com.learn.ws.client.LibraryServiceClient.main(LibraryServiceClient.java:40)
  </code></pre>
  
  <h1>SEI</h1>
  
  <pre><code>@WebService(name="library", targetNamespace="http://service.ws.learn.com")  
  @BindingType(value="http://www.w3.org/2003/05/soap/bindings/HTTP/")
  
  public interface LibraryService {
  
          @WebMethod(operationName="getBooks")
          @ResponseWrapper(className="com.learn.ws.model.BookList", targetNamespace="http://service.ws.learn.com")
          @WebResult(name="bookList")
          public BookList getBooks();
  }
  </code></pre>
  
  <h1>Service pom</h1>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.learn.ws&lt;/groupId&gt;
    &lt;artifactId&gt;LibraryWeb&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;properties&gt;
  
          &lt;!-- Generic properties --&gt;
          &lt;java.version&gt;1.6&lt;/java.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;!-- Spring --&gt;
          &lt;spring-framework.version&gt;3.2.3.RELEASE&lt;/spring-framework.version&gt;
  
          &lt;!-- Logging --&gt;
          &lt;logback.version&gt;1.0.13&lt;/logback.version&gt;
          &lt;slf4j.version&gt;1.7.5&lt;/slf4j.version&gt;
  
      &lt;/properties&gt;
  
      &lt;build&gt;
      &lt;finalName&gt;LibraryWeb&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;webXml&gt;src/main/webapp/WEB-INF/web.xml&lt;/webXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
  
          &lt;!-- Other Web dependencies --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging with SLF4J &amp; LogBack --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${slf4j.version}&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- C X F --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
              &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt; 
  &lt;/project&gt;
  </code></pre>
  
  <h1>Client Code</h1>
  
  <pre><code>        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
          Client client = dcf.createClient("http://localhost:7001/LibraryWeb/services/library?wsdl");
  
          Object[] res;
          try {
              res = client.invokeWrapped("getBooks");
              System.out.println("List Of Books \n"+res[0]);
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <h1>Client pom</h1>
  
  <pre><code>&lt;project 
          xmlns="http://maven.apache.org/POM/4.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;org.springframework.samples&lt;/groupId&gt;
    &lt;artifactId&gt;LibraryWebClientSpring&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
    &lt;properties&gt;
  
          &lt;!-- Generic properties --&gt;
          &lt;java.version&gt;1.6&lt;/java.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
  
          &lt;!-- Spring --&gt;
          &lt;spring-framework.version&gt;3.2.3.RELEASE&lt;/spring-framework.version&gt;
  
          &lt;!-- Logging --&gt;
          &lt;logback.version&gt;1.0.13&lt;/logback.version&gt;
          &lt;slf4j.version&gt;1.7.5&lt;/slf4j.version&gt;
  
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Spring and Transactions --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${spring-framework.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;!-- Logging with SLF4J &amp; LogBack --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${slf4j.version}&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-frontend-jaxws&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-transports-http&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
              &lt;artifactId&gt;cxf-rt-transports-http-jetty&lt;/artifactId&gt;
              &lt;version&gt;3.0.0&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt; 
  &lt;/project&gt;
  </code></pre>