tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley_Lee <>
Subject Tomcat hang when call HttpURLConnection.connect() in init()
Date Fri, 05 May 2006 22:19:03 GMT

I try to detect another web application's accessibility in Servlet's init()
URL url = new URL("http://localhost:8080/xyz");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

When application "xyz" is NOT available, above code:
- runs fine in standalone Java application (return File-not-found exception)
- runs fine if deploy to a running Tomcat

but it will hang Tomcat startup if it is in /web-apps while Tomcat restart.
I have to manually kill Tomcat process, then log will show ConnectException.
Looks like Tomcat is waiting on that connect() call.

Is there any work-around or better way to detect app's availability?

Thanks for any suggestion!

View this message in context:
Sent from the Tomcat - User forum at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message