cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject git commit: [CXF-5681] If the user has provided catalogs, but no CatalogManager is found, make sure we log a warning. If no user specified catalogs are there, don't worry about it.
Date Fri, 11 Apr 2014 14:48:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0455e7be2 -> 7823e9956


[CXF-5681] If the user has provided catalogs, but no CatalogManager is found, make sure we
log a warning.  If no user specified catalogs are there, don't worry about it.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/7823e995
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7823e995
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7823e995

Branch: refs/heads/master
Commit: 7823e9956675248f5b73001d68d6e62c3514a815
Parents: 0455e7b
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Apr 11 10:40:16 2014 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Apr 11 10:41:24 2014 -0400

----------------------------------------------------------------------
 .../apache/cxf/catalog/OASISCatalogManager.java   | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/7823e995/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java b/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
index b69b0a3..6c5e17e 100644
--- a/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
+++ b/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
@@ -135,14 +135,17 @@ public class OASISCatalogManager {
     }
 
     public final void loadCatalogs(ClassLoader classLoader, String name) throws IOException
{
-        if (classLoader == null || catalog == null) {
+        if (classLoader == null) {
             return;
         }
 
         Enumeration<URL> catalogs = classLoader.getResources(name);
         while (catalogs.hasMoreElements()) {
             URL catalogURL = catalogs.nextElement();
-            if (!loadedCatalogs.contains(catalogURL.toString())) {
+            if (catalog == null) {
+                LOG.log(Level.WARNING, "Catalog found at {0} but no org.apache.xml.resolver.CatalogManager
was found."
+                        + "  Check the classpatch for an xmlresolver jar.", catalogURL.toString());
+            } else if (!loadedCatalogs.contains(catalogURL.toString())) {
                 ((Catalog)catalog).parseCatalog(catalogURL);
                 loadedCatalogs.add(catalogURL.toString());
             }
@@ -150,7 +153,7 @@ public class OASISCatalogManager {
     }
 
     public final void loadCatalog(URL catalogURL) throws IOException {
-        if (!loadedCatalogs.contains(catalogURL.toString()) && catalog != null) {
+        if (!loadedCatalogs.contains(catalogURL.toString())) {
             if ("file".equals(catalogURL.getProtocol())) {
                 try {
                     File file = new File(catalogURL.toURI());
@@ -162,9 +165,14 @@ public class OASISCatalogManager {
                 }
             }
 
-            ((Catalog)catalog).parseCatalog(catalogURL);
+            if (catalog == null) {
+                LOG.log(Level.WARNING, "Catalog found at {0} but no org.apache.xml.resolver.CatalogManager
was found."
+                        + "  Check the classpatch for an xmlresolver jar.", catalogURL.toString());
+            } else {
+                ((Catalog)catalog).parseCatalog(catalogURL);
 
-            loadedCatalogs.add(catalogURL.toString());
+                loadedCatalogs.add(catalogURL.toString());
+            }
         }
     }
     


Mime
View raw message