geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1132645 - in /geronimo/server/trunk/plugins: jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/ jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo...
Date Mon, 06 Jun 2011 13:51:18 GMT
Author: xuhaihong
Date: Mon Jun  6 13:51:17 2011
New Revision: 1132645

URL: http://svn.apache.org/viewvc?rev=1132645&view=rev
Log:
GERONIMO-5993 MyFaces WebApplicationContext might not work if multiple JSF web applications
in the same EAR package
Now, the name of web module will be used as the key.

Modified:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/facelet/GeronimoFaceletConfigResourceProviderFactory.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/info/GeronimoFacesConfigurationMergerFactory.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/webapp/MyFacesWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
Mon Jun  6 13:51:17 2011
@@ -149,6 +149,16 @@ public class WebAppContextWrapper implem
 
         holder = holder == null ? Holder.EMPTY : holder;
 
+        this.server = server;
+        this.application = application;
+        this.objectName = objectName;
+        if (objectName != null) {
+            ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
+            verifyObjectName(myObjectName);
+        }
+        this.jettyContainer = jettyContainer;
+        this.originalSpecDD = originalSpecDD;
+
         RunAsSource runAsSource1 = runAsSource == null ? RunAsSource.NULL : runAsSource;
 
         SessionHandler sessionHandler;
@@ -217,6 +227,7 @@ public class WebAppContextWrapper implem
         webAppContext.setContextPath(contextPath);
         //See Jetty-386.  Setting this to true can expose secured content.
         webAppContext.setCompactPath(compactPath);
+        webAppContext.setWebModuleName(getWARName());
 
         if (workDir == null) {
             workDir = contextPath.replace('/', '_');
@@ -240,16 +251,6 @@ public class WebAppContextWrapper implem
         mimeTypes.setMimeMap(webAppInfo.mimeMappings);
         webAppContext.setMimeTypes(mimeTypes);
 
-        this.server = server;
-        this.application = application;
-        this.objectName = objectName;
-        if (objectName != null) {
-            ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
-            verifyObjectName(myObjectName);
-        }
-        this.jettyContainer = jettyContainer;
-        this.originalSpecDD = originalSpecDD;
-
         //DONT install the jetty TLD configuration as we find and create all the listeners
ourselves
         webAppContext.setConfigurationClasses(new String[]{});
 

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
Mon Jun  6 13:51:17 2011
@@ -85,6 +85,7 @@ public class GeronimoWebAppContext exten
     private final ApplicationPolicyConfigurationManager applicationPolicyConfigurationManager;
     private ServiceRegistration serviceRegistration;
     boolean fullyStarted = false;
+    private String webModuleName;
 
     public GeronimoWebAppContext(SecurityHandler securityHandler,
                                  SessionHandler sessionHandler,
@@ -110,6 +111,8 @@ public class GeronimoWebAppContext exten
         setAttribute("org.springframework.osgi.web." + BundleContext.class.getName(),
                      bundle.getBundleContext());
 
+        setAttribute(WebApplicationConstants.WEB_APP_NAME, webModuleName);
+
         // now set the module context ValidatorFactory in a context property.
         try {
             javax.naming.Context ctx = integrationContext.getComponentContext();
@@ -128,6 +131,10 @@ public class GeronimoWebAppContext exten
 
     }
 
+    public void setWebModuleName(String webModuleName) {
+        this.webModuleName = webModuleName;
+    }
+
     public void registerServletContext() {
         // for OSGi Web Applications support register ServletContext in service registry
         Bundle bundle = integrationContext.getBundle();

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
Mon Jun  6 13:51:17 2011
@@ -77,6 +77,8 @@ import org.eclipse.jetty.security.UserAu
 import org.eclipse.jetty.security.authentication.FormAuthenticator;
 import org.eclipse.jetty.server.Authentication;
 import org.eclipse.jetty.server.UserIdentity;
+import org.junit.After;
+import org.junit.Before;
 import org.osgi.framework.Bundle;
 
 
@@ -156,7 +158,7 @@ public class AbstractWebModuleTest exten
                 cl,
                 null,
                 null);
-        WebAppContextWrapper app = new WebAppContextWrapper(null,
+        WebAppContextWrapper app = new WebAppContextWrapper("geronimo:J2EEServer=geronimo,name=hello.war,J2EEApplication=null,j2eeType=WebModule",
                 contextPath,
                 null,
                 null,
@@ -245,6 +247,7 @@ public class AbstractWebModuleTest exten
     protected void tearDownSecurity() throws Exception {
     }
 
+    @Before
     protected void setUp() throws Exception {
         cl = this.getClass().getClassLoader();
 
@@ -273,6 +276,7 @@ public class AbstractWebModuleTest exten
         transactionManager.addTransactionAssociationListener(new GeronimoTransactionListener(connectionTrackingCoordinator));
     }
 
+    @After
     protected void tearDown() throws Exception {
         connector.doStop();
         Thread.sleep(1000);

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
Mon Jun  6 13:51:17 2011
@@ -72,7 +72,7 @@ public class StatTest extends AbstractWe
                 aStts = stats.getStatistic(sttsName);
                 assertTrue("startTime was not set for " + sttsName, aStts.getStartTime()
!= 0);
                 assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime()
!= 0);
-                /*System.out.println("              lastSampleTime = " + aStts.getLastSampleTime()
+ 
+                /*System.out.println("              lastSampleTime = " + aStts.getLastSampleTime()
+
             	    "  startTime = " + aStts.getStartTime());
                 System.out.println(aStts);*/
             }

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/facelet/GeronimoFaceletConfigResourceProviderFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/facelet/GeronimoFaceletConfigResourceProviderFactory.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/facelet/GeronimoFaceletConfigResourceProviderFactory.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/facelet/GeronimoFaceletConfigResourceProviderFactory.java
Mon Jun  6 13:51:17 2011
@@ -24,11 +24,9 @@ import java.util.Collection;
 import javax.faces.context.ExternalContext;
 
 import org.apache.geronimo.myfaces.webapp.MyFacesWebAppContext;
-import org.apache.geronimo.osgi.web.WABApplicationConstants;
+import org.apache.geronimo.web.WebApplicationConstants;
 import org.apache.myfaces.spi.FaceletConfigResourceProvider;
 import org.apache.myfaces.spi.FaceletConfigResourceProviderFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
 
 /**
  * @version $Rev$ $Date$
@@ -40,8 +38,8 @@ public class GeronimoFaceletConfigResour
     @Override
     public FaceletConfigResourceProvider createFaceletConfigResourceProvider(ExternalContext
externalContext) {
         if (faceletConfigResourceProvider == null) {
-            Bundle bundle = ((BundleContext) externalContext.getApplicationMap().get(WABApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE)).getBundle();
-            final MyFacesWebAppContext myFacesWebAppContext = MyFacesWebAppContext.getMyFacesWebAppContext(bundle);
+            String webModuleName = (String) externalContext.getApplicationMap().get(WebApplicationConstants.WEB_APP_NAME);
+            final MyFacesWebAppContext myFacesWebAppContext = MyFacesWebAppContext.getMyFacesWebAppContext(webModuleName);
             faceletConfigResourceProvider = new FaceletConfigResourceProvider() {
 
                 @Override

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/info/GeronimoFacesConfigurationMergerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/info/GeronimoFacesConfigurationMergerFactory.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/info/GeronimoFacesConfigurationMergerFactory.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/info/GeronimoFacesConfigurationMergerFactory.java
Mon Jun  6 13:51:17 2011
@@ -20,12 +20,10 @@ package org.apache.geronimo.myfaces.info
 import javax.faces.context.ExternalContext;
 
 import org.apache.geronimo.myfaces.webapp.MyFacesWebAppContext;
-import org.apache.geronimo.osgi.web.WABApplicationConstants;
+import org.apache.geronimo.web.WebApplicationConstants;
 import org.apache.myfaces.config.element.FacesConfigData;
 import org.apache.myfaces.spi.FacesConfigurationMerger;
 import org.apache.myfaces.spi.FacesConfigurationMergerFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
 
 /**
  * @version $Rev$ $Date$
@@ -37,9 +35,8 @@ public class GeronimoFacesConfigurationM
     @Override
     public FacesConfigurationMerger getFacesConfigurationMerger(ExternalContext externalContext)
{
         if (facesConfigurationMerger == null) {
-            Bundle bundle = ((BundleContext) externalContext.getApplicationMap().get(
-                    WABApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE)).getBundle();
-            final MyFacesWebAppContext myFacesWebAppContext = MyFacesWebAppContext.getMyFacesWebAppContext(bundle);
+            String webModuleName = (String) externalContext.getApplicationMap().get(WebApplicationConstants.WEB_APP_NAME);
+            final MyFacesWebAppContext myFacesWebAppContext = MyFacesWebAppContext.getMyFacesWebAppContext(webModuleName);
             facesConfigurationMerger = new FacesConfigurationMerger() {
 
                 @Override

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/webapp/MyFacesWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/webapp/MyFacesWebAppContext.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/webapp/MyFacesWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces/src/main/java/org/apache/geronimo/myfaces/webapp/MyFacesWebAppContext.java
Mon Jun  6 13:51:17 2011
@@ -25,11 +25,13 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.myfaces.config.resource.ConfigurationResource;
 import org.apache.geronimo.myfaces.config.resource.osgi.api.ConfigRegistry;
 import org.apache.myfaces.config.element.FacesConfigData;
@@ -47,7 +49,7 @@ public class MyFacesWebAppContext implem
 
     private static final Logger logger = LoggerFactory.getLogger(MyFacesWebAppContext.class);
 
-    private static final Map<Bundle, MyFacesWebAppContext> MYFACES_WEBAPP_CONTEXTS
= new ConcurrentHashMap<Bundle, MyFacesWebAppContext>();
+    private static final Map<String, MyFacesWebAppContext> MYFACES_WEBAPP_CONTEXTS
= new ConcurrentHashMap<String, MyFacesWebAppContext>();
 
     private FacesConfigData facesConfigData;
 
@@ -57,12 +59,17 @@ public class MyFacesWebAppContext implem
 
     private List<URL> faceletConfigResources;
 
+    private AbstractName abName;
+
     public MyFacesWebAppContext(@ParamAttribute(name = "facesConfigData") FacesConfigData
facesConfigData,
-            @ParamAttribute(name = "faceletConfigResources") Set<ConfigurationResource>
faceletConfigResources, @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
-            @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader)
{
+            @ParamAttribute(name = "faceletConfigResources") Set<ConfigurationResource>
faceletConfigResources,
+            @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
+            @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader classLoader,
+            @ParamSpecial(type = SpecialAttributeType.abstractName) AbstractName abName)
{
         this.bundle = BundleUtils.unwrapBundle(bundle);
         this.facesConfigData = facesConfigData;
         this.classLoader = classLoader;
+        this.abName = abName;
         ServiceReference serviceReference = null;
         this.faceletConfigResources = new ArrayList<URL>(faceletConfigResources.size());
         try {
@@ -109,17 +116,21 @@ public class MyFacesWebAppContext implem
         }
     }
 
+    public String getWebModuleName(){
+        return abName.getNameProperty(NameFactory.WEB_MODULE);
+    }
+
     @Override
     public void doStart() throws Exception {
-        MYFACES_WEBAPP_CONTEXTS.put(bundle, this);
+        MYFACES_WEBAPP_CONTEXTS.put(getWebModuleName(), this);
     }
 
     @Override
     public void doStop() throws Exception {
-        MYFACES_WEBAPP_CONTEXTS.remove(bundle);
+        MYFACES_WEBAPP_CONTEXTS.remove(getWebModuleName());
     }
 
-    public static MyFacesWebAppContext getMyFacesWebAppContext(Bundle bundle) {
-        return MYFACES_WEBAPP_CONTEXTS.get(bundle);
+    public static MyFacesWebAppContext getMyFacesWebAppContext(String webModuleName) {
+        return MYFACES_WEBAPP_CONTEXTS.get(webModuleName);
     }
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
Mon Jun  6 13:51:17 2011
@@ -34,6 +34,7 @@ import java.util.Stack;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import javax.naming.Context;
 import javax.naming.directory.DirContext;
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginException;
@@ -156,7 +157,7 @@ public class GeronimoStandardContext ext
         setResources(createDirContext(ctx));
 
         // Create ReadOnlyContext
-        javax.naming.Context enc = ctx.getJndiContext();
+        Context enc = ctx.getJndiContext();
         setInstanceManager(ctx.getInstanceManager());
         ServletContext servletContext = getServletContext();
 
@@ -167,6 +168,9 @@ public class GeronimoStandardContext ext
             setServer(tomcatWebAppContext.getServer());
             setJ2EEApplication(tomcatWebAppContext.getJ2EEApplication());
             setJ2EEServer(tomcatWebAppContext.getJ2EEServer());
+
+            servletContext.setAttribute(WebApplicationConstants.WEB_APP_NAME, tomcatWebAppContext.getWARName());
+
             //install jasper injection support if required
             if (tomcatWebAppContext.getRuntimeCustomizer() != null) {
                 Map<String, Object> attributes = new HashMap<String, Object>();

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Mon Jun  6 13:51:17 2011
@@ -372,8 +372,6 @@ public class TomcatContainer implements 
         ContextConfig config = new EjbWsContextConfig(webAppInfo, policyContextId,  configurationFactory,
defaultSubject, authMethod, realmName);
         context.addLifecycleListener(config);
 
-        Context webServiceContext = (context);
-
         String virtualServer;
         if (virtualHosts != null && virtualHosts.length > 0) {
             virtualServer = virtualHosts[0];
@@ -386,8 +384,8 @@ public class TomcatContainer implements 
             throw new IllegalArgumentException("Invalid virtual host '" + virtualServer +
"'.  Do you have a matchiing Host entry in the plan?");
         }
 
-        host.addChild(webServiceContext);
-        webServices.put(contextPath, webServiceContext);
+        host.addChild(context);
+        webServices.put(contextPath, context);
     }
 
     public void removeWebService(String contextPath) {

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
Mon Jun  6 13:51:17 2011
@@ -49,8 +49,9 @@ public class TomcatEJBWebServiceContext 
         this.setParentClassLoader(classLoader);
         this.setDelegate(true);
 
-        log.debug("EJB Webservice Context = " + contextPath);
-
+        if (log.isDebugEnabled()) {
+            log.debug("EJB Webservice Context = " + contextPath);
+        }
         this.classLoader = classLoader;
 
         //Create a dummy wrapper
@@ -133,12 +134,12 @@ public class TomcatEJBWebServiceContext 
             return request.getHeader(name);
         }
 
-        public java.net.URI getURI() {
+        public URI getURI() {
             if (uri == null) {
                 try {
                     //String uriString = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getLocalPort() + request.getRequestURI();
                     //return new java.net.URI(uri.getScheme(),uri.getHost(),uri.getPath(),uri.);
-                    uri = new java.net.URI(request.getScheme(), null, request.getServerName(),
request.getServerPort(), request.getRequestURI(), request.getQueryString(), null);
+                    uri = new URI(request.getScheme(), null, request.getServerName(), request.getServerPort(),
request.getRequestURI(), request.getQueryString(), null);
                 } catch (URISyntaxException e) {
                     throw new IllegalStateException(e.getMessage(), e);
                 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=1132645&r1=1132644&r2=1132645&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Mon Jun  6 13:51:17 2011
@@ -112,7 +112,7 @@ public abstract class AbstractWebModuleT
         deploymentAttributes.put(WebApplicationConstants.SCHEMA_VERSION, 3.0f);
         TomcatWebAppContext app = new TomcatWebAppContext(cl, //classLoader
                 bundle, //bundle
-                null,   //objectName
+                "geronimo:J2EEServer=geronimo,name=hello.war,J2EEApplication=null,j2eeType=WebModule",
  //objectName
                 "/test",    //contextPath
                 null,   //originalSpecDD
                 "", //modulePath



Mime
View raw message