Exception in thread "main" javax.xml.stream.FactoryFinder$ConfigurationError: Provider com.sun.xml.stream.ZephyrParserFactory not found at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:152) at javax.xml.stream.FactoryFinder.findJarServiceProvider(FactoryFinder.java:328) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:253) at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:177) at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:153) at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.getXMLInputFactory(XMLStreamReaderFactory.java:109) at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:78) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:805) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:262) at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:129) at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:265) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:228) at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:176) at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:104) at javax.xml.ws.Service.<init>(Service.java:77) at com.szboanda.common.wsdl.business.INFXQDJWS.<init>(INFXQDJWS.java:42) at com.szboanda.common.wsdl.business.TestResult.main(TestResult.java:40) Caused by: java.lang.ClassNotFoundException: com.sun.xml.stream.ZephyrParserFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) at javax.xml.stream.FactoryFinder.getProviderClass(FactoryFinder.java:112) at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:143) ... 16 more
原因:
网上找了一下原因,有些说是和帆软报表的fr-third-8.0.jar冲突,尝试了下去掉fr-third-8.0.jar后,确认不再报错,调用成功,但是这个fr-third-8.0.jar是帆软报表必须要用的jar。看到另外一解答是:估计你的问题不是包冲突, 而是你的webservice所需的包根本没有放到lib目录中,找一个包含有com.sun.xml.stream.ZephyrParserFactory 的包试试, 比如这个sjsxp.jar或 sjsxp-1.0.1.jar 或sjsxp-ri.jar。于是网上下载了sjsxp-1.0.1.jar,导入之后果然没有报错,正常调用。
时间: 2024-10-08 08:47:35