You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2011/05/24 16:23:58 UTC

svn commit: r1127076 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java

Author: ema
Date: Tue May 24 14:23:58 2011
New Revision: 1127076

URL: http://svn.apache.org/viewvc?rev=1127076&view=rev
Log:
[CXF-3544]:ignore the build failed policy

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java?rev=1127076&r1=1127075&r2=1127076&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java Tue May 24 14:23:58 2011
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 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;
@@ -31,6 +32,7 @@ import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
+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;
@@ -61,6 +63,7 @@ import org.apache.neethi.PolicyReference
 @NoJSR250Annotations
 public class Wsdl11AttachmentPolicyProvider extends AbstractPolicyProvider 
     implements PolicyProvider {
+    private static final Logger LOG = LogUtils.getL7dLogger(Wsdl11AttachmentPolicyProvider.class);
 
     public Wsdl11AttachmentPolicyProvider() {
         this(null);
@@ -182,10 +185,15 @@ public class Wsdl11AttachmentPolicyProvi
                     
                     if (Constants.isPolicyElement(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());
+                        }
                     }
                 }
             }