cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss_eng2000 <ss.engineering2...@gmail.com>
Subject cxf-client: how to use a fresh http connection for multiple soap calls
Date Wed, 04 Apr 2012 19:28:09 GMT
Hi,

I am using a generated java cxf-client to make multiple soap calls to a soap
server. This is done in the same thread. I'm running into an error where the
second soap call made on a keepAlive http connection always fails. It looks
like cxf is using the same underlying http connection to make the multiple
calls within the same thread. Is that to be expected? How can I make my
cxf-client create a fresh http connection for each soap call? 

If I configure the soap server to not use the keepAlive connection, sending
of multiple soap calls work. I do not want to launch this way. I also
experimented with creating the javax.xml.ws.Service every time I need to
create a send a soap request. That still results in the same error on the
second soap request.

Note: this works on my personal environment (macosx 10.6.8) and not in other
linux environments. 

thanks.
-S

Stack Trace:

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:263)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533)
	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:88)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
	at $Proxy71.shoppingCartProductRemove(Unknown Source)
	at
com.lockerz.catalog.service.CatalogServiceMagentoImpl$1.doSpecifics(CatalogServiceMagentoImpl.java:144)
	at
com.lockerz.catalog.service.CatalogServiceMagentoImpl.executeSoap(CatalogServiceMagentoImpl.java:235)
	at
com.lockerz.catalog.service.CatalogServiceMagentoImpl.deleteItemsInCart(CatalogServiceMagentoImpl.java:140)
	at
com.lockerz.order.queue.CatalogUpdatorWorker$2.doInTransaction(CatalogUpdatorWorker.java:105)
	at
com.lockerz.order.queue.CatalogUpdatorWorker$2.doInTransaction(CatalogUpdatorWorker.java:88)
	at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
	at
com.lockerz.order.queue.CatalogUpdatorWorker.run(CatalogUpdatorWorker.java:88)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketException: SocketException invoking
http://magento-int.lockerz.us/index.php/api/v2_soap/index/: Unexpected end
of file from server
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1431)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1416)
	at
org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:195)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 21 more
Caused by: java.net.SocketException: Unexpected end of file from server
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:781)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
	at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1542)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1402)


--
View this message in context: http://cxf.547215.n5.nabble.com/cxf-client-how-to-use-a-fresh-http-connection-for-multiple-soap-calls-tp5618816p5618816.html
Sent from the cxf-issues mailing list archive at Nabble.com.

Mime
View raw message