Author: adrianc
Date: Tue Sep 25 11:12:34 2012
New Revision: 1389802
URL:
http://svn.apache.org/viewvc?rev=1389802&view=revLog:
Fixed a bug introduced in rev 1334336 - do not throw an exception if the web.xml file does not exist.
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=1389802&r1=1389801&r2=1389802&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 Tue Sep 25 11:12:34 2012
@@ -622,21 +622,25 @@ public class CatalinaContainer implement
}
final String webXmlFilePath = new StringBuilder().append("file:///").append(location).append("/WEB-INF/web.xml").toString();
-
- URL webXmlUrl;
+ boolean appIsDistributable = distribute;
+ URL webXmlUrl = null;
try {
webXmlUrl = FlexibleLocation.resolveLocation(webXmlFilePath);
} catch (MalformedURLException e) {
throw new ContainerException(e);
}
- Document webXmlDoc = null;
- try {
- webXmlDoc = UtilXml.readXmlDocument(webXmlUrl);
- } catch (Exception e) {
- throw new ContainerException(e);
+ File webXmlFile = new File(webXmlUrl.getFile());
+ if (webXmlFile.exists()) {
+ Document webXmlDoc = null;
+ try {
+ webXmlDoc = UtilXml.readXmlDocument(webXmlUrl);
+ } catch (Exception e) {
+ throw new ContainerException(e);
+ }
+ appIsDistributable = webXmlDoc.getElementsByTagName("distributable").getLength() > 0;
+ } else {
+ Debug.logInfo(webXmlFilePath + " not found.", module);
}
-
- boolean appIsDistributable = webXmlDoc.getElementsByTagName("distributable").getLength() > 0;
final boolean contextIsDistributable = distribute && appIsDistributable;
// configure persistent sessions