Fixed: Issue starting ofbiz from tar distribution (OFBIZ-12118)

Avoid using caches when opening a URL connection to read an XML resource
in a JAR file.

If caches were used when running from the ofbiz.jar file then attempts
to read resources from the jar would fail due to the cached file's
InputStream already being in a closed state.

Thanks: Eugen Stan for the bug report and fix.
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
index 8e942c5..3d001d6 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java
@@ -29,6 +29,7 @@
 import java.io.Reader;
 import java.io.Writer;
 import java.net.URL;
+import java.net.URLConnection;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
@@ -379,7 +380,12 @@
             Debug.logWarning("[UtilXml.readXmlDocument] URL was null, doing nothing", MODULE);
             return null;
         }
-        try (InputStream is = url.openStream()) {
+
+        URLConnection connection = url.openConnection();
+        // OFBIZ-12118: Ensure caching is disabled otherwise we may find another thread has already closed the
+        // underlying file's InputStream when dealing with URLs to JAR resources.
+        connection.setUseCaches(false);
+        try (InputStream is = connection.getInputStream()) {
             return readXmlDocument(is, validate, url.toString());
         }
     }