Author: mbrohl
Date: Mon Apr 29 09:01:52 2019
New Revision: 1858349
URL:
http://svn.apache.org/viewvc?rev=1858349&view=revLog:
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/branches/release17.12/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
Modified: ofbiz/ofbiz-framework/branches/release17.12/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java?rev=1858349&r1=1858348&r2=1858349&view=diff==============================================================================
--- ofbiz/ofbiz-framework/branches/release17.12/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/ofbiz-framework/branches/release17.12/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java Mon Apr 29 09:01:52 2019
@@ -218,7 +218,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);
}
@@ -485,6 +488,7 @@ public class CatalinaContainer implement
return new Callable<Context>() {
public Context call() throws ContainerException, LifecycleException {
StandardContext context = prepareContext(host, configuration, appInfo, clusterProp);
+ Debug.logInfo("host[" + host + "].addChild(" + context + ")", module);
host.addChild(context);
return context;
}
@@ -502,7 +506,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());