ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1689936 - in /webservices/wss4j/trunk/ws-security-common: pom.xml src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
Date Wed, 08 Jul 2015 18:56:55 GMT
Author: dkulp
Date: Wed Jul  8 18:56:55 2015
New Revision: 1689936

URL: http://svn.apache.org/r1689936
Log:
Temporary make the net.shibboleth stuff optional to allow some OSGi testing while we figure
out a proper solution

Modified:
    webservices/wss4j/trunk/ws-security-common/pom.xml
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java

Modified: webservices/wss4j/trunk/ws-security-common/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/pom.xml?rev=1689936&r1=1689935&r2=1689936&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/pom.xml (original)
+++ webservices/wss4j/trunk/ws-security-common/pom.xml Wed Jul  8 18:56:55 2015
@@ -30,7 +30,8 @@
     
     <properties>
         <wss4j.osgi.import>
-            org.joda.time*;version="[1.6,3)"
+            org.joda.time*;version="[1.6,3)",
+            net.shibboleth*;resolution:=optional
         </wss4j.osgi.import>
         <!--
                         <DynamicImport-Package>

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java?rev=1689936&r1=1689935&r2=1689936&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
(original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/OpenSAMLUtil.java
Wed Jul  8 18:56:55 2015
@@ -21,7 +21,6 @@ package org.apache.wss4j.common.saml;
 
 import javax.xml.namespace.QName;
 
-import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.xml.BasicParserPool;
 
 import org.apache.wss4j.common.crypto.WSProviderConfig;
@@ -93,20 +92,28 @@ public final class OpenSAMLUtil {
                 marshallerFactory = XMLObjectProviderRegistrySupport.getMarshallerFactory();
                 unmarshallerFactory = XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
                 
-                BasicParserPool pp = new BasicParserPool();
-                pp.setMaxPoolSize(50);
-                pp.initialize();
-                providerRegistry.setParserPool(pp);
+                try {
+                    configureParserPool(providerRegistry);
+                } catch (Throwable t) {
+                    LOG.warn("Unable to bootstrap the parser pool part of the opensaml library
- some SAML operations may fail", t);
+                }
                 
                 samlEngineInitialized = true;
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("opensaml3 library bootstrap complete");
                 }
-            } catch (XMLConfigurationException | ComponentInitializationException ex) {
+            } catch (XMLConfigurationException ex) {
                 LOG.error("Unable to bootstrap the opensaml3 library - all SAML operations
will fail", ex);
             }
         }
     }
+    
+    private static void configureParserPool(XMLObjectProviderRegistry reg) throws Throwable
{
+        BasicParserPool pp = new BasicParserPool();
+        pp.setMaxPoolSize(50);
+        pp.initialize();
+        reg.setParserPool(pp);        
+    }
 
     /**
      * Convert a SAML Assertion from a DOM Element to an XMLObject



Mime
View raw message