Author: jleroux
Date: Sun Nov 20 09:43:22 2016
New Revision: 1770540
URL:
http://svn.apache.org/viewvc?rev=1770540&view=revLog:
Fixed: ConfigXMLReader doesn't verify if "transaction-timeout" is set before
trying to unbox
(OFBIZ-8342)
site-conf.xsd doesn't define transaction-timeout as being mandatory but
ConfigXMLReader treats it as one and in the absence of the attribute an
exception is being thrown causing the application to break.
jleroux: I have slightly modified the patch, eventElement.getAttribute never
returns null, default to empty
Thanks: Valery Chenzo
Modified:
ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
Modified: ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java?rev=1770540&r1=1770539&r2=1770540&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java (original)
+++ ofbiz/trunk/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java Sun Nov 20 09:43:22 2016
@@ -511,7 +511,10 @@ public class ConfigXMLReader {
this.path = eventElement.getAttribute("path");
this.invoke = eventElement.getAttribute("invoke");
this.globalTransaction = !"false".equals(eventElement.getAttribute("global-transaction"));
- this.transactionTimeout = Integer.valueOf(eventElement.getAttribute("transaction-timeout"));
+ String tt = eventElement.getAttribute("transaction-timeout");
+ if(!tt.isEmpty()) {
+ this.transactionTimeout = Integer.valueOf(tt);
+ }
// Get metrics.
Element metricsElement = UtilXml.firstChildElement(eventElement, "metric");
if (metricsElement != null) {