我正在运行一个用java编写的程序,部署在Oracle应用程序服务器上,运行1.5 JVM。以下是堆栈跟踪:
Exception in thread "main" java.lang.NoSuchMethodError: com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.getNamespaceContext()Lcom/sun/org/apache/xerces/internal/xni/NamespaceContext;
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:99)
at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:264)
at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:136)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Zephyr.newInstance(XMLStreamReaderFactory.java:251)
at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.<clinit>(XMLStreamReaderFactory.java:84)
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:56)
at com.earthport.bind.MerchantAPIService.<init>(MerchantAPIService.java:50)
at com.earthport.client.service.stub.MerchantAPIClientImpl$1CustomMerchantAPIService. <init>(MerchantAPIClientImpl.java:107)
at com.earthport.client.service.stub.MerchantAPIClientImpl.createMerchantAPIService(MerchantAPI ClientImpl.java:111)
at com.earthport.client.service.stub.MerchantAPIClientImpl.<init> (MerchantAPIClientImpl.java:84)
at com.earthport.client.service.ServiceProxyFactoryImpl.createServiceProxy(ServiceProxyFactoryI mpl.java:25)
at utils.AmxEPAccCre.<init>(AmxEPAccCre.java:79)
at utils.WService.<init>(WService.java:95)
at utils.WService.main(WService.java:795)
Process exited.
如果我用jdk 1.6运行完全相同的程序,那么这个程序运行得很完美。这是图书馆参考资料的特定问题吗?以前有人见过这个例外吗?
欢呼。
我敢打赌,您的应用程序或Oracle AppServer附带的Xerces实现与JDK附带的实现之间存在冲突。
它可以和JDK6中的那个兼容,但和JDK5中的那个不兼容。