Author: doogie
Date: Sun Jun 26 18:11:50 2011
New Revision: 1139891
URL:
http://svn.apache.org/viewvc?rev=1139891&view=revLog:
FIX: Fix multiple mounting of webapps for different vhosts; the unique key
used for duplication detection needs to contain more than just the mount
point.
Modified:
ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=1139891&r1=1139890&r2=1139891&view=diff==============================================================================
--- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Sun Jun 26 18:11:50 2011
@@ -631,11 +631,23 @@ public class CatalinaContainer implement
if (webResourceInfos != null) {
for (int i = webResourceInfos.size(); i > 0; i--) {
ComponentConfig.WebappInfo appInfo = webResourceInfos.get(i - 1);
- String mount = appInfo.getContextRoot();
+ String engineName = appInfo.server;
List<String> virtualHosts = appInfo.getVirtualHosts();
- if (!loadedMounts.contains(mount) || UtilValidate.isNotEmpty(virtualHosts)) {
+ String mount = appInfo.getContextRoot();
+ List<String> keys = FastList.newInstance();
+ if (UtilValidate.isEmpty(virtualHosts)) {
+ keys.add(engineName + ":DEFAULT:" + mount);
+ } else {
+ for (String virtualHost: virtualHosts) {
+ keys.add(engineName + ":" + virtualHost + ":" + mount);
+ }
+ }
+ if (!keys.removeAll(loadedMounts)) {
+ // nothing was removed from the new list of keys; this
+ // means there are no existing loaded entries that overlap
+ // with the new set
createContext(appInfo);
- loadedMounts.add(mount);
+ loadedMounts.addAll(keys);
} else {
appInfo.appBarDisplay = false; // disable app bar display on overrided apps
Debug.logInfo("Duplicate webapp mount; not loading : " + appInfo.getName() + " / " + appInfo.getLocation(), module);