diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
index 2cf12ceda1..2de80bc046 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
@@ -47,7 +47,7 @@ import org.w3c.dom.Element;
/**
* An object that models the <ofbiz-component> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -458,7 +458,8 @@ public final class ComponentConfig {
} catch (ContainerException ce) {
throw new ComponentException("Error reading container configurations for component: " + this.globalName, ce);
}
- Debug.logVerbose("Read component config : [" + rootLocation + "]", module);
+ if (Debug.verboseOn())
+ Debug.logVerbose("Read component config : [" + rootLocation + "]", module);
}
public boolean enabled() {
@@ -595,7 +596,7 @@ public final class ComponentConfig {
/**
* An object that models the <classpath> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -618,7 +619,7 @@ public final class ComponentConfig {
private final Map componentConfigs = new LinkedHashMap<>();
// Root location mapped to global name.
private final Map componentLocations = new HashMap<>();
-
+
private synchronized ComponentConfig fromGlobalName(String globalName) {
return componentConfigs.get(globalName);
}
@@ -645,7 +646,7 @@ public final class ComponentConfig {
/**
* An object that models the <entity-resource> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -662,7 +663,7 @@ public final class ComponentConfig {
/**
* An object that models the <keystore> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -739,7 +740,7 @@ public final class ComponentConfig {
/**
* An object that models the <resource-loader> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -759,7 +760,7 @@ public final class ComponentConfig {
/**
* An object that models the <service-resource> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -774,7 +775,7 @@ public final class ComponentConfig {
/**
* An object that models the <test-suite> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
@@ -786,7 +787,7 @@ public final class ComponentConfig {
/**
* An object that models the <webapp> element.
- *
+ *
* @see ofbiz-component.xsd
*
*/
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentLoaderConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentLoaderConfig.java
index 82ce905d25..611bdad102 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentLoaderConfig.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentLoaderConfig.java
@@ -55,7 +55,7 @@ public final class ComponentLoaderConfig {
public static List getComponentsFromConfig(URL configUrl) throws ComponentException {
Document document = parseDocumentFromUrl(configUrl);
List extends Element> toLoad = UtilXml.childElementList(document.getDocumentElement());
- List componentsFromConfig = new ArrayList<>();
+ List componentsFromConfig = new ArrayList();
for (Element element : toLoad) {
componentsFromConfig.add(retrieveComponentDefFromElement(element, configUrl));
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java
index e2bbf7b218..e0cf0e101f 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentResourceHandler.java
@@ -18,19 +18,15 @@
*******************************************************************************/
package org.apache.ofbiz.base.component;
-import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import javax.xml.parsers.ParserConfigurationException;
-
import org.apache.ofbiz.base.config.GenericConfigException;
import org.apache.ofbiz.base.config.ResourceHandler;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilXml;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
/**
* Contains resource information and provides for loading data
@@ -54,7 +50,7 @@ public class ComponentResourceHandler implements ResourceHandler {
this.componentName = componentName;
this.loaderName = loaderName;
this.location = location;
- Debug.logVerbose("Created " + this.toString(), module);
+ if (Debug.verboseOn()) Debug.logVerbose("Created " + this.toString(), module);
}
public String getLoaderName() {
@@ -68,7 +64,11 @@ public class ComponentResourceHandler implements ResourceHandler {
public Document getDocument() throws GenericConfigException {
try {
return UtilXml.readXmlDocument(this.getStream(), this.getFullLocation(), true);
- } catch (SAXException | ParserConfigurationException | IOException e) {
+ } catch (org.xml.sax.SAXException e) {
+ throw new GenericConfigException("Error reading " + this.toString(), e);
+ } catch (javax.xml.parsers.ParserConfigurationException e) {
+ throw new GenericConfigException("Error reading " + this.toString(), e);
+ } catch (java.io.IOException e) {
throw new GenericConfigException("Error reading " + this.toString(), e);
}
}