Bug 54458

Summary: DataSourceRealm should provide more info on SQLException
Product: Tomcat 7 Reporter: mkbucc
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 7.0.34   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X 10.4   
Attachments: Patch proposal

Description mkbucc 2013-01-21 21:56:02 UTC
The getPassword() method of the DataSourceRealm does not log enough information when it encounters an SQL error.  The catch block is:

        } catch(SQLException e) {
            containerLog.error(
                    sm.getString("dataSourceRealm.getPassword.exception",
                                 username));
        } finally {

it would be really helpful to have some details of what the SQLException is.  I am getting this intermittently, and have resorted to subclassing getPassword() in an attempt to figure out what is going wrong.
Comment 1 Violeta Georgieva 2013-01-22 20:07:54 UTC
Created attachment 29883 [details]
Patch proposal

+1

Information for SQLException can be provided for methods:
- getPassword(Connection, String)
- getRoles(Connection, String)
Comment 2 Mark Thomas 2013-01-23 15:57:56 UTC
Thanks for the patch. It has been applied to trunk and 7.0.x and will be included in 7.0.36 onwards.