This particular environment has funny classloader behavior.  So only
the System classloader resolves.

Accordingly, Engine NPEs due to a bad assumption here:

            ClassLoader cl = getClassLoader();  // this may return
null since it doesn't try System classloader
            URL configURL = cl.getResource(providerResource); // boom

My patch was to fix getClassLoader(), but while an effective fix, I'm
not sure that's what should be done:

Index: modules/org.restlet/src/org/restlet/util/Engine.java
===================================================================
--- modules/org.restlet/src/org/restlet/util/Engine.java        (revision 3945)
+++ modules/org.restlet/src/org/restlet/util/Engine.java        (working copy)
@@ -107,6 +107,10 @@
             result = Class.class.getClassLoader();
         }

+        if (result == null) {
+            result = ClassLoader.getSystemClassLoader();
+        }
+
         return result;
     }

Reply via email to