[jbossws-commits] JBossWS SVN: r14430 - thirdparty/cxf/branches/cxf-2.2.6-patch-01_JBPAPP-6440/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed May 25 20:06:42 EDT 2011


Author: bmaxwell
Date: 2011-05-25 20:06:41 -0400 (Wed, 25 May 2011)
New Revision: 14430

Modified:
   thirdparty/cxf/branches/cxf-2.2.6-patch-01_JBPAPP-6440/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
Log:
[JBPAPP-6440] CXF-3544 ignore the build failed policy 

Modified: thirdparty/cxf/branches/cxf-2.2.6-patch-01_JBPAPP-6440/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.6-patch-01_JBPAPP-6440/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java	2011-05-25 16:41:03 UTC (rev 14429)
+++ thirdparty/cxf/branches/cxf-2.2.6-patch-01_JBPAPP-6440/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java	2011-05-26 00:06:41 UTC (rev 14430)
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
 import javax.wsdl.extensions.ExtensibilityElement;
@@ -30,6 +31,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.service.model.AbstractDescriptionElement;
@@ -58,6 +60,7 @@
  */
 public class Wsdl11AttachmentPolicyProvider extends AbstractPolicyProvider 
     implements PolicyProvider {
+    private static final Logger LOG = LogUtils.getL7dLogger(Wsdl11AttachmentPolicyProvider.class);
 
     public Wsdl11AttachmentPolicyProvider() {
         this(null);
@@ -179,10 +182,15 @@
                     
                     if (PolicyConstants.isPolicyElem(e.getElementType())
                         && !StringUtils.isEmpty(uri)) {
-                        Policy policy = builder.getPolicy(e.getElement());
-                        String fragement = "#" + uri;
-                        registry.register(fragement, policy);
-                        registry.register(di.getBaseURI() + fragement, policy);
+                        try {
+                            Policy policy = builder.getPolicy(e.getElement());
+                            String fragement = "#" + uri;
+                            registry.register(fragement, policy);
+                            registry.register(di.getBaseURI() + fragement, policy);
+                        } catch (Exception policyEx) {
+                            //ignore the policy can not be built
+                            LOG.warning("Failed to build the policy '" + uri + "':" + policyEx.getMessage());
+                        }
                     }
                 }
             }



More information about the jbossws-commits mailing list