0 Replies Latest reply on Jun 3, 2016 6:31 PM by moic

    Cannot create a secure XMLInputFactory (JBoss 5.1 AS)

    moic

      I am trying to generate a "Java Bean Skeleton" from a wsdl file using Apache CXF 2.7. I was following this tutorial: kaustuv's blog: Web Services example using CXF & JBOSS but have encountered an error on my end when generating the Java Bean Skeleton. On the step where they do it in the link provided, after I click finish I get this error:

       

      Loading FrontEnd jaxws ...
      Loading DataBinding jaxb ...
      wsdl2java -d C:\Users\mo\Documents\Workspace\v2.0\TestWebService\.cxftmp/src -classdir C:\Users\mo\Documents\Workspace\v2.0\TestWebService\build\classes -p MNPProtocol.xsd=popo -impl -validate -exsh false -dns true -dex true -wsdlLocation file:/C:/Users/mo/Documents/Workspace/v2.0/TestWebService/WebContent/WEB-INF/wsdl/testservice.wsdl -verbose -sn testservice -defaultValues -fe jaxws -db jaxb -wv 1.1 file:/C:/Users/mo/Documents/Workspace/v2.0/TestWebService/WebContent/WEB-INF/wsdl/testservice.wsdl
      wsdl2java - Apache CXF 2.7.18
      
      
      WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition file:/C:/Users/mo/Documents/Workspace/v2.0/TestWebService/WebContent/WEB-INF/wsdl/testservice.wsdl: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
      
      org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition file:/C:/Users/mo/Documents/Workspace/v2.0/TestWebService/WebContent/WEB-INF/wsdl/testservice.wsdl: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
          at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420)
          at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
          at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
          at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
          at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
      Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition file:/C:/Users/mo/Documents/Workspace/v2.0/TestWebService/WebContent/WEB-INF/wsdl/testservice.wsdl: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
          at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:97)
          at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.java:69)
          at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:83)
          at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:60)
          at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:198)
          at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
          at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
          ... 4 more
      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
          at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:264)
          at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:206)
          at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
          ... 10 more
      Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
          at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:315)
          at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:265)
          at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1774)
          at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1673)
          at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:254)
          ... 12 more
      

       

      Am I not configuring something in my Eclipse workspace correctly? This is a regular Dynamic Web Project. Why can't it create a secure XMLInputFactory? Sorry if this is in the wrong place, not sure where to post it.