tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley_Lee <marmot...@yahoo.com>
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()
method: 
URL url = new URL("http://localhost:8080/xyz");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();

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!

Stanley
--
View this message in context: http://www.nabble.com/Tomcat-hang-when-call-HttpURLConnection.connect%28%29-in-init%28%29-t1566864.html#a4255448
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message