geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r426522 - in /geronimo/sandbox/svkmerge/m2migration/modules/deployment/src: ./ java/org/apache/geronimo/deployment/Deployer.java
Date Fri, 28 Jul 2006 13:26:18 GMT
Author: jdillon
Date: Fri Jul 28 06:26:18 2006
New Revision: 426522

URL: http://svn.apache.org/viewvc?rev=426522&view=rev
Log:
 r570@Bliss (orig r426508):  jdillon | 2006-07-28 06:19:07 -0700
  r557@Bliss (orig r426349):  jsisson | 2006-07-27 18:09:35 -0700
  GERONIMO-2222 (Merged from 1.1 branch) Application errors in static initialization blocks
during serialization of configuration during deployment due to incorrect TCCL
 

Modified:
    geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/   (props changed)
    geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java

Propchange: geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/
------------------------------------------------------------------------------
--- svk:merge (added)
+++ svk:merge Fri Jul 28 06:26:18 2006
@@ -0,0 +1 @@
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/deployment/src:426508

Modified: geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java?rev=426522&r1=426521&r2=426522&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/deployment/src/java/org/apache/geronimo/deployment/Deployer.java
Fri Jul 28 06:26:18 2006
@@ -307,6 +307,15 @@
             if (configurations.isEmpty()) {
                 throw new DeploymentException("Deployer did not create any configurations");
             }
+
+            // Set TCCL to the classloader for the configuration being deployed
+            // so that any static blocks invoked during the loading of classes 
+            // during serialization of the configuration have the correct TCCL 
+            // ( a TCCL that is consistent with what is set when the same
+            // classes are loaded when the configuration is started.
+            Thread thread = Thread.currentThread();
+            ClassLoader oldCl = thread.getContextClassLoader();
+            thread.setContextClassLoader( context.getConfiguration().getConfigurationClassLoader());
             try {
                 if (targetFile != null) {
                     if (configurations.size() > 1) {
@@ -339,6 +348,7 @@
                 // unlikely as we just built this
                 throw new DeploymentException(e);
             } finally {
+                thread.setContextClassLoader(oldCl);
                 if (context != null) {
                     context.close();
                 }



Mime
View raw message