基于CXF的创建服务失败

时间:2015-05-11 20:21:45

标签: web-services soap jboss wsdl cxf

我们最近开始遇到与创建基于CXF的SOAP服务相关的错误。有问题的代码部署在临时和生产环境中,每个环境上的2个节点上。在每个环境中,节点是负载平衡的,并且彼此完全独立。该问题仅在登台环境中有效。在上周五问题首次出现前10天进行了升级 生产环境运行相同的代码并正常工作。

以下是产生错误的代码。正如您所看到的,在设置端点或进行调用之前,尝试读取同一战争中打包的WSDL时会出现问题。系统的其余部分,包括其他基于CXF的Web服务,都可以正常工作。

URL wsdl = getClass().getResource("/wsdl/globalplatform/v2.0.0/wsdl/SELifeCycleNotification.wsdl");
SELifeCycleNotificationService service = new SELifeCycleNotificationService(wsdl, new QName("http://globalplatform.org/selifecyclenotification", "SELifeCycleNotificationService"));

堆栈跟踪如下。我们使用带有jboss 5.0.1和JDK 1.6的CXF 2.2.9版。出于显而易见的原因,升级cxf,jboss或jdk不是一种选择。在全局级别更改超时设置似乎也不是一个好选择,因为它可能会影响所有的一切,我不喜欢它。

有人可以指出可能导致此问题的原因吗?由于问题表现在同一环境的booth节点上,很可能是由两个受影响的节点共同的东西引起的,比如网络设置。但是,wsdl读取操作应该是本地的,两台机器都有足够的可用磁盘空间和为JVM分配的RAM,并且系统的其余部分工作正常。

非常感谢任何帮助。

javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:152)
        at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
        at javax.xml.ws.Service.<init>(Service.java:36)
        at org.globalplatform.selifecyclenotification.SELifeCycleNotificationService.<init>(SELifeCycleNotificationService.java:42)
        at com.somecompany.services.tsm.queue.DeviceChangeQueuedMessageSender.sendMessage(DeviceChangeQueuedMessageSender.java:38)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:93)
        at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:207)
        at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150)
        ... 30 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'vfszip:/opt/path/jboss-5.0.1.GA/server/default/deploy/somecompany-tsm-services.war/WEB-INF/lib/somecompany-gp-soap-messages-1.0-BRANCH.jar/wsdl/globalplatform/v2.0.0/xsd/xmldsig-core-schema.xsd'.: java.net.ConnectException: Connection timed out
        at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:230)
        at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
        ... 32 more
Caused by: java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.http.HttpClient.New(HttpClient.java:323)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:975)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1177)
        at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
        at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)
        at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        ... 43 more

0 个答案:

没有答案