Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DF08B9827 for ; Tue, 6 Mar 2012 14:38:04 +0000 (UTC) Received: (qmail 23831 invoked by uid 500); 6 Mar 2012 14:38:01 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 23612 invoked by uid 500); 6 Mar 2012 14:38:00 -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 23601 invoked by uid 99); 6 Mar 2012 14:38:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 14:38:00 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.62.48] (HELO qmta05.westchester.pa.mail.comcast.net) (76.96.62.48) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2012 14:37:54 +0000 Received: from omta15.westchester.pa.mail.comcast.net ([76.96.62.87]) by qmta05.westchester.pa.mail.comcast.net with comcast id iCfT1i0031swQuc55EdaMY; Tue, 06 Mar 2012 14:37:34 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.109.145]) by omta15.westchester.pa.mail.comcast.net with comcast id iEdZ1i00r38FjT13bEdZ7H; Tue, 06 Mar 2012 14:37:34 +0000 Message-ID: <4F56212E.6010208@christopherschultz.net> Date: Tue, 06 Mar 2012 09:37:34 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: JDBC Pool - Error handling during connection creation References: In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Amit, On 3/6/12 4:46 AM, amit shah wrote: > Hello, I am using the tomcat jdbc pool independently in my > application and frequently I faced a NullPointerException with the > below stack trace > > null at > org.apache.tomcat.jdbc.pool.ConnectionPool.setupConnection(ConnectionPool.java:276) What > exact version of Tomcat and/or the Tomcat pool are you using? > The root cause of the exception is suppressed by the jdbc pool code > by returning null from the validate() method. My point of raising > this up is that it becomes hard to troubleshoot such errors in > production when the actual exception is suppressed. The actual > exception occurs while executing the initSQL query or the > validation query. > > Shouldn't an exception be thrown right at the point where the > error occurred? I don't see any place in setupConnection where an exception is swallowed, do you? http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?view=markup - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk9WIS4ACgkQ9CaO5/Lv0PAyFACfe/0jqpUzA1krhuxTFb/4sxJQ 46oAoJXV48dwC6IFy4f1dozhOc45Wo3R =ZHQa -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org