You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2012/09/23 00:35:18 UTC

svn commit: r1388914 - in /cxf/branches/2.5.x-fixes: ./ rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml

Author: ay
Date: Sat Sep 22 22:35:17 2012
New Revision: 1388914

URL: http://svn.apache.org/viewvc?rev=1388914&view=rev
Log:
Merged revisions 1388912 via  svn merge from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1388912 | ay | 2012-09-23 00:25:27 +0200 (Sun, 23 Sep 2012) | 9 lines
  
  Merged revisions 1388911 via  svn merge from
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1388911 | ay | 2012-09-23 00:15:01 +0200 (Sun, 23 Sep 2012) | 1 line
    
    [CXF-4517] ClassCastException in WS-RM when RMP 200702 assertions are used
  ........
  
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt
    cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml

Propchange: cxf/branches/2.5.x-fixes/
            ('svn:mergeinfo' removed)

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java?rev=1388914&r1=1388913&r2=1388914&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RM10PolicyUtils.java Sat Sep 22 22:35:17 2012
@@ -21,7 +21,9 @@ package org.apache.cxf.ws.rm.policy;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.logging.Logger;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.ws.policy.AssertionInfo;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
@@ -37,6 +39,7 @@ import org.apache.cxf.ws.rmp.v200502.RMA
  * 
  */
 public final class RM10PolicyUtils {
+    private static final Logger LOG = LogUtils.getL7dLogger(RM10PolicyUtils.class); 
     
     /**
      * Prevents instantiation.
@@ -58,6 +61,8 @@ public final class RM10PolicyUtils {
             if (ais != null) {
                 mergedAsserts.addAll(ais);
             }
+
+            //REVISIT this class shouldn't be picking RMP200702 assertions (see below)
             ais = aim.get(RM11Constants.WSRMP_RMASSERTION_QNAME);
             if (ais != null) {
                 mergedAsserts.addAll(ais);
@@ -78,9 +83,15 @@ public final class RM10PolicyUtils {
         RMAssertion compatible = defaultValue;
         Collection<AssertionInfo> ais = collectRMAssertions(message.get(AssertionInfoMap.class));
         for (AssertionInfo ai : ais) {
-            JaxbAssertion<RMAssertion> ja = getAssertion(ai);
-            RMAssertion rma = ja.getData();
-            compatible = null == defaultValue ? rma : intersect(compatible, rma);
+            //REVISIT this class can't handle RMP200702 assertions, so guard against CCE 
+            if (ai.getAssertion() instanceof JaxbAssertion 
+                && ((JaxbAssertion<?>)ai.getAssertion()).getData() instanceof RMAssertion) {
+                JaxbAssertion<RMAssertion> ja = getAssertion(ai);
+                RMAssertion rma = (RMAssertion)ja.getData(); 
+                compatible = null == defaultValue ? rma : intersect(compatible, rma);
+            } else {
+                LOG.warning("Ignoring unexpected assertion class: " + ai.getAssertion());
+            }
         }
         return compatible;
     }

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt?rev=1388914&r1=1388913&r2=1388914&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/bus-extensions.txt Sat Sep 22 22:35:17 2012
@@ -1,4 +1,5 @@
 org.apache.cxf.ws.rm.RMManager::true
 org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider::true
 org.apache.cxf.ws.rm.policy.RMAssertionBuilder::true
+org.apache.cxf.ws.rm.policy.RM11AssertionBuilder::true:true
 

Modified: cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml?rev=1388914&r1=1388913&r2=1388914&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml (original)
+++ cxf/branches/2.5.x-fixes/rt/ws/rm/src/main/resources/META-INF/cxf/cxf-extension-rm.xml Sat Sep 22 22:35:17 2012
@@ -39,4 +39,9 @@ http://www.springframework.org/schema/be
         <constructor-arg ref="cxf"/>
         <constructor-arg value="org.apache.cxf.ws.rm.policy.RMAssertionBuilder"/>
     </bean>
+    <bean id="org.apache.cxf.ws.rm.policy.RM11AssertionBuilder"
+        class="org.apache.cxf.bus.spring.OldSpringSupport" lazy-init="true">
+        <constructor-arg ref="cxf"/>
+        <constructor-arg value="org.apache.cxf.ws.rm.policy.RM11AssertionBuilder"/>
+    </bean>
 </beans>
\ No newline at end of file