ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1171326 - in /webservices/wss4j/trunk: pom.xml src/main/java/org/apache/ws/security/WSSConfig.java
Date Thu, 15 Sep 2011 23:29:28 GMT
Author: dkulp
Date: Thu Sep 15 23:29:28 2011
New Revision: 1171326

URL: http://svn.apache.org/viewvc?rev=1171326&view=rev
Log:
Workaround an issue on the IBM JDK that seems to be blocking dynamic
imports of the XMLDSigRI class when running in equinox.

Modified:
    webservices/wss4j/trunk/pom.xml
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSSConfig.java

Modified: webservices/wss4j/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/pom.xml?rev=1171326&r1=1171325&r2=1171326&view=diff
==============================================================================
--- webservices/wss4j/trunk/pom.xml (original)
+++ webservices/wss4j/trunk/pom.xml Thu Sep 15 23:29:28 2011
@@ -140,7 +140,7 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>2.1.0</version>
+                <version>2.3.4</version>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
@@ -160,7 +160,7 @@
                               javax.xml.crypto.*,
                               org.apache.xml.security.*,
                               org.bouncycastle.*;resolution:=optional,
-                              org.jcp.xml.dsig.internal.*,
+                              org.jcp.xml.dsig.internal.dom.*,
                               org.opensaml.*;resolution:=optional,
                               *;resolution:=optional
                         </Import-Package>

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSSConfig.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSSConfig.java?rev=1171326&r1=1171325&r2=1171326&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSSConfig.java (original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/WSSConfig.java Thu Sep 15
23:29:28 2011
@@ -36,6 +36,7 @@ import org.apache.ws.security.util.Loade
 import org.apache.ws.security.util.UUIDGenerator;
 import org.apache.ws.security.validate.Validator;
 import org.apache.xml.security.utils.XMLUtils;
+import org.jcp.xml.dsig.internal.dom.XMLDSigRI;
 
 /**
  * WSSConfig <p/> Carries configuration data so the WSS4J spec compliance can be
@@ -400,12 +401,13 @@ public class WSSConfig {
             if (addJceProviders) {
                 AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
                     public Boolean run() {
-                        addJceProvider("XMLDSig", "org.jcp.xml.dsig.internal.dom.XMLDSigRI");
+                        addXMLDSigRI();
                         addJceProvider("BC", "org.bouncycastle.jce.provider.BouncyCastleProvider");
                         Security.removeProvider("STRTransform");
                         appendJceProvider(
                             "STRTransform", new org.apache.ws.security.transform.STRTransformProvider()
                         );
+                        
                         return true;
                     }
                 });
@@ -414,6 +416,18 @@ public class WSSConfig {
         }
     }
     
+    private static void addXMLDSigRI() {
+        try {
+            addXMLDSigRIInternal();
+        } catch (Throwable t) {
+            //ignore - may be a NoClassDefFound if XMLDSigRI isn't avail
+            return;
+        }
+    }
+    public static void addXMLDSigRIInternal() {
+        addJceProvider("XMLDSig", new XMLDSigRI());
+    }
+    
     /**
      * @return a new WSSConfig instance configured with the default values
      */



Mime
View raw message