-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amit,

On 3/7/12 12:12 AM, amit shah wrote:
> I am using tomcat-jdbc.jar and tomcat-juli.jar from version
> 7.0.26.
> 
>> 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
>
>> 
> Have a look at the public boolean validate(int
> validateAction,String sql) method in PooledConnection class line no
> - 445.

> The validate method ignores any exception which is thrown while
> validating the connection or executing the initSQL query.

If you have debug logging enabled, it will log the exception. So,
enable debug logging and try again. *shrug*

> The createConnection() method in ConnectionPool class which calls
> the validate() method returns null in such a case and hence it
> leads to a null pointer exception in setupConnection method.
> 
> Ignoring the exception in the validate() method may sound
> appropriate (not sure for what reason though) but my point is that
> it makes troubleshooting the issue a lot harder.

Just turn on debug logging and you'll see the original exception. I
think in this case, the error is quite fatal so checking for null and
emitting some other error message would only be slightly more helpful
to you, but the effect would be the same.

- -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/

iEYEARECAAYFAk9XfYMACgkQ9CaO5/Lv0PBdqQCgjhbGeAQ2QU64XOrYP5VBEkF6
VkoAoL6g5gMTaYpnHvj7HZDqWT6P+qcE
=AzPZ
-----END PGP SIGNATURE-----

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

Reply via email to