geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r437361 - /geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
Date Sun, 27 Aug 2006 10:37:11 GMT
Author: jdillon
Date: Sun Aug 27 03:37:10 2006
New Revision: 437361

URL: http://svn.apache.org/viewvc?rev=437361&view=rev
Log:
(GERONIMO-2346) Fixed groupId so the DB Info page works again; applied patch from Bill Dudney...
thanks :-)
Added some logging around the initialization code to show details if this breaks again

Modified:
    geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java?rev=437361&r1=437360&r2=437361&view=diff
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
(original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/internaldb/DerbyConnectionUtil.java
Sun Aug 27 03:37:10 2006
@@ -39,6 +39,8 @@
  * requested for the SystemDatabase this class gets a DataSource from an admin
  * object registered in the geronimo kernel otherwise the DataSource is looked
  * up via JNDI.
+ *
+ * @version $Rev$ $Date$
  */
 public class DerbyConnectionUtil {
 
@@ -63,16 +65,34 @@
     private static AbstractName SYSTEM_DATASOURCE_NAME = null;
     
     static {
-    	// look up the system data source name without using the version number
-    	HashMap props = new HashMap();
-    	props.put("name","SystemDatasource");
-    	props.put("j2eeType","JCAManagedConnectionFactory");
-    	Artifact systemDB = new Artifact("geronimo", "system-database", (Version)null, "car");
-    	AbstractNameQuery query = new AbstractNameQuery(systemDB,props);
-    	Iterator iter = KernelRegistry.getSingleKernel().listGBeans(query).iterator();
-    	if (iter.hasNext()) {
-    		SYSTEM_DATASOURCE_NAME = (AbstractName)iter.next();
-    	}
+        try {
+            log.debug("Looking up system datasource name...");
+            
+            // look up the system data source name without using the version number
+            HashMap props = new HashMap();
+            props.put("name","SystemDatasource");
+            props.put("j2eeType","JCAManagedConnectionFactory");
+            Artifact systemDB = new Artifact("org.apache.geronimo.configs", "system-database",
(Version)null, "car");
+            AbstractNameQuery query = new AbstractNameQuery(systemDB,props);
+            Iterator iter = KernelRegistry.getSingleKernel().listGBeans(query).iterator();
+            
+            if (iter.hasNext()) {
+                SYSTEM_DATASOURCE_NAME = (AbstractName)iter.next();
+                log.debug("Using system datasource name: " + SYSTEM_DATASOURCE_NAME);
+            }
+            else {
+                log.warn("Failed to lookup system datasource name");
+            }
+        }
+        catch (Throwable t) {
+            //
+            // HACK: Log any errors which occur when this is loading...
+            //       the system is not logging the full detail, which it should
+            //       but for now lets show the details here
+            //
+            log.error("Failed to initialize", t);
+            throw new Error(t);
+        }
     }
 
     /**



Mime
View raw message