You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/01/15 00:58:44 UTC

svn commit: r734567 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt java/org/apache/catalina/realm/JDBCRealm.java java/org/apache/catalina/realm/LocalStrings.properties webapps/docs/changelog.xml

Author: markt
Date: Wed Jan 14 15:58:44 2009
New Revision: 734567

URL: http://svn.apache.org/viewvc?rev=734567&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46298
Throw and SQLException with a useful message rather than a NPE if the URL for the JDBCRealm is invalid.
Based on a patch by Owen Jacobson

Modified:
    tomcat/tc6.0.x/trunk/   (props changed)
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/LocalStrings.properties
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 14 15:58:44 2009
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,718360,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,730250,732859
+/tomcat/trunk:601180,606992,612607,630314,652744,653247,673796,673820,683982,684001,684081,684234,684269-684270,687503,687645,690781,691392,691805,692748,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,718360,719602,719626,719628,720046,720069,721040,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729809,730250,732859

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=734567&r1=734566&r2=734567&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan 14 15:58:44 2009
@@ -150,14 +150,6 @@
    0: funkman - ditto
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46298
-  Throw and SQLException with a useful message rather than a NPE if the URL for
-  the JDBCRealm is invalid.
-  Based on a patch by Owen Jacobson
-  http://svn.apache.org/viewvc?rev=729809&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46261
   %2F in a context path should be interpreted literally, not as /. That is what
   # is for.

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=734567&r1=734566&r2=734567&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java Wed Jan 14 15:58:44 2009
@@ -700,6 +700,10 @@
         if (connectionPassword != null)
             props.put("password", connectionPassword);
         dbConnection = driver.connect(connectionURL, props);
+        if (dbConnection == null) {
+            throw new SQLException(sm.getString(
+                    "jdbcRealm.open.invalidurl",driverName, connectionURL));
+        }
         dbConnection.setAutoCommit(false);
         return (dbConnection);
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/LocalStrings.properties?rev=734567&r1=734566&r2=734567&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/LocalStrings.properties (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/realm/LocalStrings.properties Wed Jan 14 15:58:44 2009
@@ -53,6 +53,7 @@
 jdbcRealm.getPassword.exception=Exception retrieving password for "{0}"
 jdbcRealm.getRoles.exception=Exception retrieving roles for "{0}"
 jdbcRealm.open=Exception opening database connection
+jdbcRealm.open.invalidurl=Driver "{0}" does not support the url "{1}"
 jndiRealm.authenticateFailure=Username {0} NOT successfully authenticated
 jndiRealm.authenticateSuccess=Username {0} successfully authenticated
 jndiRealm.close=Exception closing directory server connection

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=734567&r1=734566&r2=734567&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jan 14 15:58:44 2009
@@ -213,6 +213,11 @@
         standard endorsed mechanism. (markt)
       </fix>
       <fix>
+        <bug>46298</bug>: Throw an SQLException with a useful message rather
+        than a NPE if the URL for the JDBCRealm is invalid. Based on a patch by
+        Owen Jacobson. (markt)
+      </fix>
+      <fix>
         <bug>46304</bug>: Further fixes to make Principal accessible (if set)
         via <code>Subject.getSubject(AccessController.getContext())</code> when
         processing filters. (markt)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org