You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by dk...@apache.org on 2012/06/22 19:16:03 UTC
svn commit: r1352979 -
/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java
Author: dkulp
Date: Fri Jun 22 17:16:02 2012
New Revision: 1352979
URL: http://svn.apache.org/viewvc?rev=1352979&view=rev
Log:
In OSGi, the OpenSaml classloader will not be able to find the WSS4J
provided configuration. Override the method so that we can load the
config files ourselves and pass them into OpenSaml
Modified:
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java
Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java?rev=1352979&r1=1352978&r2=1352979&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/saml/ext/OpenSAMLBootstrap.java Fri Jun 22 17:16:02 2012
@@ -19,8 +19,12 @@
package org.apache.ws.security.saml.ext;
+import java.io.InputStream;
+
+import org.opensaml.Configuration;
import org.opensaml.DefaultBootstrap;
import org.opensaml.xml.ConfigurationException;
+import org.opensaml.xml.XMLConfigurator;
/**
* This class intializes the Opensaml library. It is necessary to override DefaultBootstrap
@@ -71,7 +75,6 @@ public class OpenSAMLBootstrap extends D
* @throws ConfigurationException thrown if there is a problem initializing the OpenSAML library
*/
public static synchronized void bootstrap() throws ConfigurationException {
-
initializeXMLSecurity();
initializeXMLTooling(xmlToolingConfigs);
@@ -83,4 +86,17 @@ public class OpenSAMLBootstrap extends D
initializeParserPool();
}
+
+ protected static void initializeXMLTooling(String[] providerConfigs) throws ConfigurationException {
+ XMLConfigurator configurator = new XMLConfigurator();
+ for (String config : providerConfigs) {
+ //most are found in the Configuration.class classloader
+ InputStream ins = Configuration.class.getResourceAsStream(config);
+ if (ins == null) {
+ //some are from us
+ ins = OpenSAMLBootstrap.class.getResourceAsStream(config);
+ }
+ configurator.load(ins);
+ }
+ }
}