Hi,
In this commit Adrian suggested twice in RequestHandler.java
// FIXME: controller.xml errors should throw an exception.
I tried that but it implies a lot of external changes and that's 12 years ago
w/o any report about that.
So I decide to not change it. I though let the FIXME in case someone would like to
implement the "fix".
Jacques
Le 22/10/2013 à 08:50, adri...@apache.org a écrit :
Author: adrianc
Date: Tue Oct 22 06:50:05 2013
New Revision: 1534517
URL:http://svn.apache.org/r1534517
Log:
Refactored ConfigXMLReader.java - added exception handling. The class swallowed
exceptions like controller.xml file is missing or invalid - making debugging
difficult. This commit introduces a WebAppConfigurationException and it
propagates that exception farther up the stack.
Added:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/WebAppConfigurationException.java
(with props)
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandlerException.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/EventFactory.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ViewFactory.java
ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java
ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java
[...]
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL:http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1534517&r1=1534516&r2=1534517&view=diff
==============================================================================
---
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
(original)
+++
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
Tue Oct 22 06:50:05 2013
@@ -89,13 +89,24 @@ public class RequestHandler {
// init the ControllerConfig, but don't save it anywhere
this.controllerConfigURL =
ConfigXMLReader.getControllerConfigURL(context);
- ConfigXMLReader.getControllerConfig(this.controllerConfigURL);
+ try {
+ ConfigXMLReader.getControllerConfig(this.controllerConfigURL);
+ } catch (WebAppConfigurationException e) {
+ // FIXME: controller.xml errors should throw an exception.
+ Debug.logError(e, "Exception thrown while parsing controller.xml file:
", module);
+ }
this.viewFactory = new ViewFactory(this);
this.eventFactory = new EventFactory(this);
}
public ConfigXMLReader.ControllerConfig getControllerConfig() {
- return ConfigXMLReader.getControllerConfig(this.controllerConfigURL);
+ try {
+ return
ConfigXMLReader.getControllerConfig(this.controllerConfigURL);
+ } catch (WebAppConfigurationException e) {
+ // FIXME: controller.xml errors should throw an exception.
+ Debug.logError(e, "Exception thrown while parsing controller.xml file:
", module);
+ }
+ return null;
}
[...]