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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]