You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/06/15 23:25:01 UTC

svn commit: r414685 - /incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java

Author: gnodet
Date: Thu Jun 15 14:25:01 2006
New Revision: 414685

URL: http://svn.apache.org/viewvc?rev=414685&view=rev
Log:
Always return a valid class loader for the SU

Modified:
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java?rev=414685&r1=414684&r2=414685&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java (original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java Thu Jun 15 14:25:01 2006
@@ -61,13 +61,19 @@
     }
     
     public ClassLoader getConfigurationClassLoader() throws ServiceNotFoundException {
+        ClassLoader cl = null;
         if (kernel != null) {
             Object o = kernel.getServiceFactory(configuration);
             SpringConfigurationServiceFactory scsf = (SpringConfigurationServiceFactory) o;
-            return scsf.getApplicationContext().getClassLoader();
-        } else {
-            return Thread.currentThread().getContextClassLoader();
+            cl = scsf.getApplicationContext().getClassLoader();
+        } 
+        if (cl == null) {
+            cl = Thread.currentThread().getContextClassLoader();
         }
+        if (cl == null) {
+            cl = getClass().getClassLoader();
+        }
+        return cl;
     }
     
 }