[jboss-cvs] JBossAS SVN: r65040 - trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 4 08:43:20 EDT 2007


Author: remy.maucherat at jboss.com
Date: 2007-09-04 08:43:20 -0400 (Tue, 04 Sep 2007)
New Revision: 65040

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
Log:
- Better fix for JBCTS-643: processMetadata is called during the CL start. The call in the ENC listener is not actually used.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2007-09-04 12:26:08 UTC (rev 65039)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2007-09-04 12:43:20 UTC (rev 65040)
@@ -164,6 +164,9 @@
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
       metaData.setContextLoader(loader);
 
+      StandardContext context = (StandardContext) Class.forName(config.getContextClassName()).newInstance();
+      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit(), context, mainDeployer);
+
       Loader webLoader = webApp.getDeploymentUnit().getAttachment(Loader.class);
       if (webLoader == null)
          webLoader = getWebLoader(webApp.getDeploymentUnit(), metaData, loader, url);
@@ -177,11 +180,8 @@
 
       ObjectName objectName = new ObjectName(objectNameS);
 
-      StandardContext context = (StandardContext)Class.forName(config.getContextClassName()).newInstance();
       Registry.getRegistry().registerComponent(context, objectName, config.getContextClassName());
 
-      injectionContainer = new TomcatInjectionContainer(webApp, webApp.getDeploymentUnit(), context, mainDeployer);
-
       // Find and set warInfo file on the context
       // If WAR is packed, expand warInfo file to temp folder
       String ctxConfig = null;
@@ -482,11 +482,6 @@
                log.debug("linkSecurityDomain");
                linkSecurityDomain(securityDomain, envCtx);
 
-               // we need to do this because the classloader is initialize by the web container and
-               // the injection container needs the classloader so that it can build up Injectors and ENC populators
-               injectionContainer.setClassLoader(webLoader.getClassLoader());
-               injectionContainer.processMetadata();
-
                // Bind <service-ref> elements
                UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getRoot());
                EnvironmentRefGroup envRefGroup = injectionContainer.getEnvironmentRefGroup();
@@ -510,6 +505,10 @@
             }
 
             log.debug("injectionContainer enabled and processing beginning");
+            // we need to do this because the classloader is initialize by the web container and
+            // the injection container needs the classloader so that it can build up Injectors and ENC populators
+            injectionContainer.setClassLoader(webLoader.getClassLoader());
+            injectionContainer.processMetadata();
 
          }
       }




More information about the jboss-cvs-commits mailing list