"Applied fix from trunk for revision: 1770540"
------------------------------------------------------------------------
r1770540 | jleroux | 2016-11-20 10:43:22 +0100 (dim. 20 nov. 2016) | 12 lignes
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
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release16.11@1770541 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
index 4b0de7f..d851835 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
@@ -511,7 +511,10 @@
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) {