cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1127076 - /cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProvider.java
Date Tue, 24 May 2011 14:23:58 GMT
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());
+                        }
                     }
                 }
             }



Mime
View raw message