cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] 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 15:08:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.6.x-fixes 847987eb2 -> 1d7378b93


[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/3a039479
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3a039479
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3a039479

Branch: refs/heads/2.6.x-fixes
Commit: 3a0394796aab3369e2a3d341130e5a625e415f9a
Parents: 847987e
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 11:08:44 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/3a039479/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java b/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
index b69b0a3..6c5e17e 100644
--- a/rt/core/src/main/java/org/apache/cxf/catalog/OASISCatalogManager.java
+++ b/rt/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