This patch logs the exception from DriverManager.getConnection(). The
current code assumes (why?) that it should never happen.
For example, it may happen if there are incorrect security privileges, and
the user is not running with PHOENIX_SECURE=false.
--- Noel
Index: JdbcDataSource.java
===================================================================
RCS file:
/home/cvspublic/jakarta-james/src/java/org/apache/james/util/mordred/JdbcDataSource.java,v
retrieving revision 1.6
diff -u -r1.6 JdbcDataSource.java
--- JdbcDataSource.java 18 Apr 2002 19:14:55 -0000 1.6
+++ JdbcDataSource.java 14 Jun 2002 16:10:35 -0000
@@ -218,7 +218,12 @@
pool.addElement(entry);
return entry;
} catch (SQLException sqle) {
- //Shouldn't ever happen, but it did, just return null.
+ // Exception from DriverManager.getConnection() - log it, and return null
+ StringWriter sout = new StringWriter();
+ PrintWriter pout = new PrintWriter(sout, true);
+ pout.println("Error creating connection: ");
+ sqle.printStackTrace(pout);
+ getLogger().error(sout.toString());
return null;
} finally {
synchronized (this) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>