servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r393577 - /incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
Date Wed, 12 Apr 2006 18:54:57 GMT
Author: gnodet
Date: Wed Apr 12 11:54:44 2006
New Revision: 393577

URL: http://svn.apache.org/viewcvs?rev=393577&view=rev
Log:
SM-396: classloading issue in servicemix-jsr181 - thread context classloader not set to serviceunit
classloader
Patch provided by Renaud Bruyeron

Modified:
    incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java?rev=393577&r1=393576&r2=393577&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
(original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java
Wed Apr 12 11:54:44 2006
@@ -15,11 +15,12 @@
  */
 package org.apache.servicemix.jsr181;
 
+import javax.jbi.management.DeploymentException;
+
 import org.apache.servicemix.common.BaseComponent;
 import org.apache.servicemix.common.Endpoint;
 import org.apache.servicemix.common.xbean.AbstractXBeanDeployer;
-
-import javax.jbi.management.DeploymentException;
+import org.apache.servicemix.common.xbean.XBeanServiceUnit;
 
 public class Jsr181XBeanDeployer extends AbstractXBeanDeployer {
 
@@ -35,10 +36,14 @@
         if (ep.getPojo() == null && ep.getPojoClass() == null) {
             throw failure("deploy", "Endpoint must have a non-null pojo or a pojoClass",
null);
         }
+        ClassLoader old = Thread.currentThread().getContextClassLoader();
         try {
+            Thread.currentThread().setContextClassLoader(((XBeanServiceUnit)ep.getServiceUnit()).getConfigurationClassLoader());
             ep.registerService();
         } catch (Exception e) {
             throw failure("deploy", "Could not register endpoint", e);
+        } finally {
+            Thread.currentThread().setContextClassLoader(old);
         }
         return true;
     }



Mime
View raw message