From users-return-144973-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Fri May 05 22:26:23 2006 Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 11564 invoked from network); 5 May 2006 22:26:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 May 2006 22:26:22 -0000 Received: (qmail 75407 invoked by uid 500); 5 May 2006 22:26:08 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 75382 invoked by uid 500); 5 May 2006 22:26:08 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 75370 invoked by uid 99); 5 May 2006 22:26:08 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 May 2006 15:26:08 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 May 2006 15:26:07 -0700 Received: from localhost ([127.0.0.1] helo=talk.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1Fc8k7-0003j5-A2 for users@tomcat.apache.org; Fri, 05 May 2006 15:25:47 -0700 Message-ID: <4255448.post@talk.nabble.com> Date: Fri, 5 May 2006 15:19:03 -0700 (PDT) From: Stanley_Lee To: users@tomcat.apache.org Subject: Tomcat hang when call HttpURLConnection.connect() in init() MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-Sender: marmot101@yahoo.com X-Nabble-From: Stanley_Lee X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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