Derby may fail to start when it is loaded through a custom ClassLoader. The reason is that the static java.lang.ClassLoader.getSystemResources method may not find the resources loaded by a custom ClassLoader. The patch fixes that by getting the current ClassLoader and calling its getResources method.

Jack Klebanoff
Index: java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
===================================================================
--- java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java 
(revision 55637)
+++ java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java 
(working copy)
@@ -1247,9 +1247,10 @@
 
                Properties moduleList = new Properties();
         boolean firstList = true;
+        ClassLoader cl = getClass().getClassLoader();
 
         try {
-            for( Enumeration e = ClassLoader.getSystemResources( 
"org/apache/derby/modules.properties");
+            for( Enumeration e = cl.getResources( 
"org/apache/derby/modules.properties");
                  e.hasMoreElements() ;) {
                 URL modulesPropertiesURL = (URL) e.nextElement();
                 InputStream is = null;

Reply via email to