首页 > 代码库 > webservice wsdl axis2报错 Provider com.bea.xml.stream.MXParserFactory not found

webservice wsdl axis2报错 Provider com.bea.xml.stream.MXParserFactory not found

错误信息:

Exception in thread "main" javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParserFactory not found    at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)    at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)    at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)    at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)    at org.apache.axiom.om.util.StAXUtils$7.run(StAXUtils.java:504)    at java.security.AccessController.doPrivileged(Native Method)    at org.apache.axiom.om.util.StAXUtils.newXMLInputFactory(StAXUtils.java:494)    at org.apache.axiom.om.util.StAXUtils.getXMLInputFactory_perClassLoader(StAXUtils.java:565)    at org.apache.axiom.om.util.StAXUtils.getXMLInputFactory(StAXUtils.java:171)    at org.apache.axiom.om.util.StAXUtils.getXMLInputFactory(StAXUtils.java:136)    at org.apache.axiom.om.util.StAXUtils.createXMLStreamReader(StAXUtils.java:223)    at org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createXMLStreamReader(AbstractOMMetaFactory.java:53)    at org.apache.axiom.om.impl.llom.factory.AbstractOMMetaFactory.createOMBuilder(AbstractOMMetaFactory.java:95)    at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:153)    at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:133)    at org.apache.axiom.om.OMXMLBuilderFactory.createOMBuilder(OMXMLBuilderFactory.java:104)    at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:590)    at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:575)    at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:97)    at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:90)    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:857)    at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116)    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:151)    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:144)    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:251)    at org.apache.axis2.rpc.client.RPCServiceClient.<init>(RPCServiceClient.java:48)    at com.neusoft.ermsuite.css.sv.svac.svrequest.bo.test.main(test.java:17)

 

 

问题背景:

java main 中调用webservice wsdl

 

问题原因:
缺少jar包wstx-asl.jar

stax-api.jar

解决:
导入jar包

wstx-asl.jar,如果导入后仍然报错,请导入stax-api.jar

 

webservice wsdl axis2报错 Provider com.bea.xml.stream.MXParserFactory not found