svn commit: r1858347 - /ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1858347 - /ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java

mbrohl
Author: mbrohl
Date: Mon Apr 29 08:41:39 2019
New Revision: 1858347

URL: http://svn.apache.org/viewvc?rev=1858347&view=rev
Log:
Fixed: Failed registration for virtual hosts with similar mount points
(OFBIZ-10765)

The default host is now retrieved using the API instead of simply
retrieving the 1st host through Tomcat.getHost().

Modified:
    ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java

Modified: ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java?rev=1858347&r1=1858346&r2=1858347&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java Mon Apr 29 08:41:39 2019
@@ -222,7 +222,10 @@ public class CatalinaContainer implement
         Host host;
 
         if (UtilValidate.isEmpty(virtualHosts)) {
-            host = tomcat.getHost();
+            host = (Host) tomcat.getEngine().findChild(tomcat.getEngine().getDefaultHost());
+            if(host == null) {
+                host = tomcat.getHost();
+            }
         } else {
             host = prepareVirtualHost(tomcat, virtualHosts);
         }
@@ -491,6 +494,7 @@ public class CatalinaContainer implement
 
         return () -> {
             StandardContext context = prepareContext(host, configuration, appInfo, clusterProp);
+            Debug.logInfo("host[" + host + "].addChild(" + context + ")", module);
             host.addChild(context);
             return context;
         };
@@ -507,7 +511,6 @@ public class CatalinaContainer implement
 
         context.setParent(host);
         context.setDocBase(location);
-        context.setName(appInfo.name);
         context.setDisplayName(appInfo.name);
         context.setPath(getWebappMountPoint(appInfo));
         context.addLifecycleListener(new ContextConfig());