[jboss-user] [JBossWS] - Re: Using StubExt.PROPERTY_CLIENT_TIMEOUT to control timeout

jamesjoh do-not-reply at jboss.com
Thu Apr 30 17:09:43 EDT 2009

After a lot of time in the debugger I have figured out my issue.  I don't think there is a great way to 'solve' it.  Basically it looks like there are 3 seperate attempts to 'connect' to the endpoint, each one which honors the timeout.  I set my timeout to 45 seconds and it will consistently return from my dispatch.invoke call 2 minutes & 15 seconds later (45 * 3).  

First attempt: org.jboss.remoting.transport.http.HttpClientInvoker.useHttpURLConnection.  The call to conn.getOutputStream takes 45 seconds to timeout if the endpoint its trying to connect to is unavailable.  This throws an exception that is caught.  In the exception handling block there is a call to HttpUrlConnection.getResponseMessage(), which chains to HttpUrlConnection.getResponseCode().  In HttpUrlConnection.getResponseCode() there is a call to HttpUrlConnection.getInputStream() which takes 45 seconds to timeout.  After that times out it attempts to call HttpUrlConnection.getHeaderField(0) which also takes 45 seconds to time out.  Finally control returns up the stack to my dispatch call where I can deal with the timeout.

Seems pretty crappy but there doesn't appear to be anything I can do about it.  The actual code for HttpUrlConnection leads into closed source SUN code so I've hit a wall for figuring out if there's anything I can do.  Anyway hope this info helps someone, maybe someone will read this and have an idea on how to get a true 45 second timeout.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227915#4227915

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227915

More information about the jboss-user mailing list