You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2016/11/20 09:54:36 UTC

svn commit: r1770541 - in /ofbiz/branches/release16.11: ./ framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java

Author: jleroux
Date: Sun Nov 20 09:54:36 2016
New Revision: 1770541

URL: http://svn.apache.org/viewvc?rev=1770541&view=rev
Log:
"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
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release16.11/   (props changed)
    ofbiz/branches/release16.11/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java

Propchange: ofbiz/branches/release16.11/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Nov 20 09:54:36 2016
@@ -10,4 +10,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/trunk:1770481,1770490
+/ofbiz/trunk:1770481,1770490,1770540

Modified: ofbiz/branches/release16.11/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java?rev=1770541&r1=1770540&r2=1770541&view=diff
==============================================================================
--- ofbiz/branches/release16.11/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java (original)
+++ ofbiz/branches/release16.11/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ConfigXMLReader.java Sun Nov 20 09:54:36 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) {