1

Jaxws cxf client hangs after multiple calls to to the same port

I have an jaxws cxf client application running on tomcat7.

I have a very strange problem, after multiple sequential calls to the webservice server, at some point the JaxwsClientProxy hangs and a could not send message error is thrown with a caused by socketexception followed by a connection timeout.

The both connection timeout and the request timeout are already set to 5 minutes. More stranger is that this behavior may vary from machine to machine.

For example on my own computer (Mac) this does not happen and every thing works fine, but on some other machines (Windows) and the production environment (Linux) this issue exist.

I've been banging my head for a week and so far no luck. I am using the following frameworks:

- Spring 2.5
 - Jaxws CXF 2.7.11
 - Java 1.6.0_45
 - Tomcat 7

Could this be JVM bug or something? There are some forums that talk about this issue, but most of them are running on jboss and there solutions did not work for me.

I tried to change Jaxws and cxf versions but no difference. Here's a code demonstration:

GreetingsWebService service = new GreetingsWebService();
GreetingsPort port = serive.getGreetingsPort();
port.call1(); // success
port.call2(); // success
port.call3(); // error

Any advice would be greatly appreciated

1 Answers1

0

I actually solved my problem. The answer is that if you use java 1.6 with jaxws 2.2.x, you need to copy the jaxws-api.jar and jaxb-api.jar in the java endorsed or tomcat endorsed directorties. Also be sure that you generate the object with jaxws 2.2.

If you don't copy the jars in the endoresed, the java will pickup the old jaxws default jar which result in to strange problems. Also try to turnoff the allowJunk as some old server and proxies do not support junk.

  • I have a problem that feels identical to yours. Java 1.7.0_51, CXF 2.7.12, Spring 3.2, WebLogic 12c. If I have KeepAlive turned off, it fails on the second call. With KeepAlive on, it fails when the server decides to shutdown the connection. I'll try this and see if it works. What classes should I look for in the verbose classloader output to validate that I changed what I thought I changed? – Jared Aug 18 '14 at 15:00