tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: NullPointerException from incorrect JDBCRealm setup
Date Sun, 08 Dec 2002 02:11:39 GMT
To avoid it getting lost in mail folders, could you please submit a bug
report for this?

  http://nagoya.apache.org/bugzilla/

Thanks!

Craig

On Sat, 7 Dec 2002, Bill Schneider wrote:

> Date: Sat, 07 Dec 2002 17:18:23 -0500
> From: Bill Schneider <bschneider@vecna.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: NullPointerException from incorrect JDBCRealm setup
>
> Hi,
>
> I used Realms for the first time today with Tomcat 4.0.6.   I noticed that,
> if you don't specify the "userCredCol" attribute correctly with the
> JDBCRealm (for example, accidentally calling it "userCredColumn"), you end
> up with a not-too-descriptive NullPointerException.  (JDBCRealm line 389 in
> Tomcat 4.0.6.)
>
> Tracking this down in the source, it appears that if you don't specify the
> userCredCol attribute, the following SQL query results:
>
> SELECT null FROM user_table WHERE username_column = ?
>
> This is a valid query and won't throw a SQLException.  If the user exists,
> the query returns a row, but with "null" instead of the password.  The call
> to "rs.getString(1).trim()" then throws the NullPointerException.
>
> It would be useful for JDBCRealm to instead throw an exception sooner if
> either of the critical parameters are not set properly.   This would enable
> a more useful error message to be logged.
>
> -- Bill
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message