Announcement Announcement Module
Collapse
No announcement yet.
WS Client connects first time but fails on all subsequent calls Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WS Client connects first time but fails on all subsequent calls

    Hi,

    I have a WebService client configured using JaxWsPortProxyFactoryBean as below:

    Code:
    <bean id="orderWebService" class="org.springframework.remoting.jaxws.JaxWsPortProxyFactoryBean">
        <property name="serviceInterface" value="com.xxx.yyy.zzz.Order" />
        <property name="wsdlDocumentUrl" value="${xxx.yyy.zzz.wsdlDocumentUrl}" />
        <property name="namespaceUri" value="${xxx.yyy.zzz.namespaceUri}" />
        <property name="serviceName" value="${xxx.yyy.zzz.serviceName}" />
        <property name="portName" value="${xxx.yyy.zzz.portName}" />
        <property name="username" value="${xxx.yyy.zzz.username}" />
        <property name="password" value="${xxx.yyy.zzz.password}" />
        <property name="lookupServiceOnStartup" value="false" />
    </bean>
    The service itself is a third-party service hosted on a public network and I have double checked that we have all the necessary firewall openings in place.

    Problem here is that when I use the bean defined above to make calls to the WebService, the first call (after a server restart) always works and gives the desired result but all subsequent calls made using the same bean, in the same calling class fail. It does not matter what method is called the first time, it always works. But none of the calls after it.

    To complicate matters, I have a stand-alone integration test which does exactly the same thing by making more than one call to the WebService and there, it works! No matter how many calls I make, they all connect and return the expected response. All the above is on the same local environment.

    Has anyone encountered such a problem before? Below is the stack trace:
    Code:
    WARNING: Interceptor for {http://xxx.yyy.zzz/WebService/}methodName 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:271)
    	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
    	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463)
    	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366)
    	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319)
    	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
    	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:133)
    	at $Proxy47.queryOrder(Unknown Source)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.doInvoke(JaxWsPortClientInterceptor.java:526)
    	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.doInvoke(JaxWsPortClientInterceptor.java:500)
    	at org.springframework.remoting.jaxws.JaxWsPortClientInterceptor.invoke(JaxWsPortClientInterceptor.java:487)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy48.queryOrder(Unknown Source)
    	at com.xxx.payment.yyy.ws.provider.CustomWSProvider.methodName(CustomWSProvider.java:173)
    	at com.xxx.yyy.zzz.services.impl.CustomPaymentServiceImpl.method(CustomPaymentServiceImpl.java:235)
    	at com.xxx.payment.facades.PaymentFacade.methodName(PaymentFacade.java:116)
    	at com.xxx.actions.CustomAction.execute(CustomAction.java:65)
    	at de.hybris.platform.processengine.definition.ActionNode.execute(ActionNode.java:121)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner.runProcessTask(ProcessengineTaskRunner.java:220)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner$1.doInTransaction(ProcessengineTaskRunner.java:167)
    	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner.runProcessTaskInTransaction(ProcessengineTaskRunner.java:159)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner.doRun(ProcessengineTaskRunner.java:126)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner.run(ProcessengineTaskRunner.java:97)
    	at de.hybris.platform.processengine.process.ProcessengineTaskRunner.run(ProcessengineTaskRunner.java:1)
    	at de.hybris.platform.processengine.task.impl.ProcessengineTaskExecutionStrategy.run(ProcessengineTaskExecutionStrategy.java:33)
    	at de.hybris.platform.task.impl.DefaultTaskService.processTask(DefaultTaskService.java:1114)
    	at de.hybris.platform.task.impl.DefaultTaskService.process(DefaultTaskService.java:1021)
    	at de.hybris.platform.task.impl.DefaultTaskService.processInTenant(DefaultTaskService.java:981)
    	at de.hybris.platform.task.impl.DefaultTaskService$3.run(DefaultTaskService.java:886)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.net.SocketException: SocketException invoking https://ws.test.xxx.yyy.com/WebService/MethodName: Connection reset
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1336)
    	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1320)
    	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
    	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622)
    	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
    	... 38 more
    Caused by: java.net.SocketException: Connection reset
    	at java.net.SocketInputStream.read(Unknown Source)
    	at java.net.SocketInputStream.read(Unknown Source)
    	at sun.security.ssl.InputRecord.readFully(Unknown Source)
    	at sun.security.ssl.InputRecord.read(Unknown Source)
    	at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    	at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    	at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
    	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)
    	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.setupWrappedStream(URLConnectionHTTPConduit.java:170)
    	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1280)
    	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1231)
    	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.onFirstWrite(URLConnectionHTTPConduit.java:183)
    	at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:47)
    	at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
    	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1293)
    	... 41 more
Working...
X