englishteeth.co.uk

… the weblog of Ian “English Teeth” Robinson
  • rss
  • Home

Web Service Read timed out

Ian | April 16, 2008

Test first is not a silver bullet; there are still things you may not see until much later. I ran into a read time out recently that was only manifesting on a pre-production server. The stack trace indicated what was going on but the site’s behaviour was not what I would have expected.

2008-04-15 09:25:36,387 ERROR [com.foo.bar.service.impl.ServiceImpl] -
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.SocketTimeoutException: Read timed out
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
at org.apache.axis.transport.http.HTTPSender.readHeadersFromSocket(HTTPSender.java:583)

Anyway, after a bit of head scratching, it ended up being quite straightforward to recreate locally by simply overriding the JaxRpcPortProxyFactoryBean and setting the timeout to something unreasonably small.

import javax.xml.rpc.Stub;
import org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean;

public class ServiceJaxRpcFactoryBean extends JaxRpcPortProxyFactoryBean {
	private static final String TIMEOUT_PROPERTY_KEY = "axis.connection.timeout";

	protected void preparePortStub(Stub stub) {
		super.preparePortStub(stub);
		stub._setProperty(TIMEOUT_PROPERTY_KEY, new Integer(100));
	}
}
Categories
development
Tags
java, spring, testing
Comments rss
Comments rss
Trackback
Trackback

« Groovy on Grails Firefox dictionary »

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Author

Ian Robinson is a relatively agile software engineer interested in things both sides of the object relational divide and beyond.

Categories

  • development (37)
  • miscellaneous (28)
  • music (7)
  • software (19)

What I'm Doing...

  • @noelfielding11 why are you in watching telly!? in reply to noelfielding11 2010-04-16
  • What was so good about Nick Drake? These "artists" are covering, music is spot on but no effect at all. Totally lacking the goose pimples. 2010-04-16
  • Some Ginger bloke's on telly covering Nick Drake in a mediocre style. 2010-04-16
  • More updates...

Posting tweet...

Powered by Twitter Tools.

Blogroll

  • Dan North
  • Dave Astels
  • Dave Wood
  • eirikso.com
  • Matt Raible
  • Object Mentor Blog
  • The Ancient Art of Programming
  • The Wisdom of Ganesh

Tags

active-mq architecture bauhaus css db eclipse esb festivals freesat gorm grails groovy hd hibernate htpc java jboss jms junit links mce media center mini music oracle osgi patterns pirsig plugins satellite soa software spring sql struts2 testing themes tools tv vmc web wordpress xml xpath xslt
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox