Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 尝试连接到weblogic上部署的Axis2 web服务时套接字关闭_Java_Web Services_Deployment_Cxf_Weblogic 10.x - Fatal编程技术网

Java 尝试连接到weblogic上部署的Axis2 web服务时套接字关闭

Java 尝试连接到weblogic上部署的Axis2 web服务时套接字关闭,java,web-services,deployment,cxf,weblogic-10.x,Java,Web Services,Deployment,Cxf,Weblogic 10.x,我有一个应用程序正在使用ApacheCXF与Axis2 web服务通信。在测试环境中,一切都进展顺利,进入生产环境后,出现以下异常: INFO: Interceptor has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: Could not send Message. at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSende

我有一个应用程序正在使用ApacheCXF与Axis2 web服务通信。在测试环境中,一切都进展顺利,进入生产环境后,出现以下异常:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:75)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
    at $Proxy131.retrieveAccountSummary(Unknown Source)
.
.
.

Caused by: java.net.SocketException: Socket Closed
    at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:201)
    at java.net.Socket.setTcpNoDelay(Socket.java:850)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:326)
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:411)
    at weblogic.net.http.HttpClient.New(HttpClient.java:241)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:176)
    at weblogic.net.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:242)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1836)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1794)
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
    at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:70)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1854)
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
    at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:595)
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    ... 40 more
据我所知,网络上没有任何东西在终止连接,我从cxf配置中增加了ConnectionTimeout和ReceivingTimeout,但没有使用


这两个应用程序都部署在不同服务器上的weblogic 10.3.2.0上,我需要一些关于问题出在哪里的指导?什么会导致插座关闭?我不想调查与此问题无关的事情。

这是否总是在固定的持续时间=连接超时(如30或60秒)后发生,还是立即失败

如果是即时的,两台服务器之间是否建立了连接,即两者之间是否没有防火墙或其他限制?
ping
telnet
是否在两台服务器之间工作

测试设置是否与Live完全相同,即WLS和CXF版本相同?
另请参见

问题现已解决

CXF客户端访问WSDL时没有任何问题,但在WSDL中,服务端口地址设置为
localhost
,而不是服务器的IP地址:

<wsdl:service name="serviceName">
    <wsdl:port binding="tns:servicePortBinding" name="servicePort">
        <soap:address location="http://localhost:7001/app/services/service/" /> 
    </wsdl:port>
</wsdl:service>

感谢您的回复,异常在5秒内发生(增加ConnectionTimeout和ReceivingTimeout没有帮助),telnet在同一端口上工作正常。我在测试和生产环境中使用相同版本的CXF和weblogic。实际上,我偶然发现了您建议并升级了CXF版本的同一链接,在测试环境中,它一直在工作,但在生产环境中,CXF开始读取WSDL位置,就好像它部署在本地主机上一样(即,将主机ip替换为“localhost”),因此,我又回到了CXF2.1。3@Ahmad:5秒通常表示weblogic根本无法连接到其他服务器,并且超时没有出现?是否存在https url或尝试
setConnectionTimeout(0)这意味着根本没有超时。另外,请尝试将setMaxRetransmits设置为3或3。实际上,setMaxRetransmits设置为3:)我将继续按照您提到的链接建议升级CXF版本。以前,我只升级了CXF jar并添加了一个缺少的依赖项。发生以下异常:
SocketException调用http://localhost:7001/QAR%20WS/services/RetSrvc/: 套接字已关闭
,这是因为我提供了以下WSDL位置
http://10.20.11.2:7001/QAR%20WS/services/RetSrvc?wsdl这是另一台机器的IP。这次我将确保使用的是正确版本的CXF依赖项。
port = service.getMyServicePort();
BindingProvider provider = (BindingProvider) port;
String endpointAddress = "http://<ip address>:7001/app/services/service/";
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);