You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by kw...@apache.org on 2013/02/12 17:38:01 UTC

svn commit: r1445249 - in /openjpa/branches/2.2.x/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java resources/org/apache/openjpa/jdbc/schema/localizer.properties

Author: kwsutter
Date: Tue Feb 12 16:38:00 2013
New Revision: 1445249

URL: http://svn.apache.org/r1445249
Log:
OPENJPA-2332.  Updated the "no-driver" message and added a couple of additional Trace statements to help with debugging Datasource configuration issues.

Modified:
    openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
    openjpa/branches/2.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties

Modified: openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java?rev=1445249&r1=1445248&r2=1445249&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java (original)
+++ openjpa/branches/2.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java Tue Feb 12 16:38:00 2013
@@ -838,10 +838,16 @@ public class JDBCConfigurationImpl
 
             return setupConnectionFactory(ds, false);
         }
-
+                
+        if (log.isTraceEnabled())
+            log.trace("createConnectionFactory: connectionFactory not created yet, attempt JNDI lookup...");
+         
         ds = (DataSource) super.getConnectionFactory(); // JNDI lookup
-        if (ds == null)
+        if (ds == null) {
+            if (log.isTraceEnabled())
+                log.trace("createConnectionFactory: JNDI lookup failed, attempt DataSource properties...");
             ds = DataSourceFactory.newDataSource(this, false);
+        }
 
         if (log.isTraceEnabled())
             log.trace("createConnectionFactory: DataSource="+ds);

Modified: openjpa/branches/2.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/2.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties?rev=1445249&r1=1445248&r2=1445249&view=diff
==============================================================================
--- openjpa/branches/2.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties (original)
+++ openjpa/branches/2.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/schema/localizer.properties Tue Feb 12 16:38:00 2013
@@ -17,9 +17,10 @@
 
 bad-join: The following error was detected when creating a foreign key: \
 	"{0}".  The foreign key is being ignored.
-no-driver: A JDBC Driver or DataSource class name must be specified in the \
-	ConnectionDriverName property. Available properties in configuration \
-	are "{0}".
+no-driver: Attempting to use persistence.xml properties to resolve the datasource. \
+    A JDBC Driver or DataSource class name must be specified in the \
+    openjpa.ConnectionDriverName or javax.persistence.jdbc.driver property. \
+    Available properties in the configuration are "{0}". 
 bad-driver: The specified driver "{0}" is neither a java.sql.Driver \
 	nor a javax.sql.DataSource class name.
 bad-sch-ref: The schema information table could not be created: {0}