cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7142] Catching NoClassDefError in Activators expecting Blueprint being available
Date Mon, 21 Nov 2016 17:41:55 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 6cc16f1de -> 85ad51533


[CXF-7142] Catching NoClassDefError in Activators expecting Blueprint being available


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/85ad5153
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/85ad5153
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/85ad5153

Branch: refs/heads/3.1.x-fixes
Commit: 85ad5153333a32d2b185279d75cda11abf50a34f
Parents: 6cc16f1
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Nov 21 17:39:23 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Nov 21 17:41:40 2016 +0000

----------------------------------------------------------------------
 .../cxf/binding/coloc/blueprint/Activator.java  | 22 ++++++++------
 .../cxf/binding/object/blueprint/Activator.java | 22 ++++++++------
 .../cxf/binding/soap/blueprint/Activator.java   | 20 +++++++-----
 .../cxf/clustering/blueprint/Activator.java     | 20 +++++++-----
 .../apache/cxf/jaxrs/blueprint/Activator.java   | 20 +++++++-----
 .../apache/cxf/jaxws/blueprint/Activator.java   | 20 +++++++-----
 .../cxf/frontend/blueprint/Activator.java       | 20 +++++++-----
 .../cxf/jaxrs/client/blueprint/Activator.java   | 20 +++++++-----
 .../http/netty/server/blueprint/Activator.java  | 22 ++++++++------
 .../cxf/ws/addressing/blueprint/Activator.java  | 22 ++++++++------
 .../cxf/ws/policy/blueprint/Activator.java      | 32 +++++++++++---------
 .../apache/cxf/ws/rm/blueprint/Activator.java   | 24 +++++++++------
 12 files changed, 156 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/blueprint/Activator.java
b/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/blueprint/Activator.java
index 7753b49..f8a1097 100644
--- a/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/blueprint/Activator.java
+++ b/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/blueprint/Activator.java
@@ -28,15 +28,19 @@ public class Activator  implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new ColocBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/binding/coloc");     
  
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new ColocBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/binding/coloc");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/blueprint/Activator.java
b/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/blueprint/Activator.java
index 51575af..6b6e834 100644
--- a/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/blueprint/Activator.java
+++ b/rt/bindings/object/src/main/java/org/apache/cxf/binding/object/blueprint/Activator.java
@@ -28,15 +28,19 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new ObjectBindingBPHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/blueprint/binding/object");
 
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new ObjectBindingBPHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/blueprint/binding/object");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/Activator.java
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/Activator.java
index 3a8231f..719d4da 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/Activator.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/blueprint/Activator.java
@@ -28,14 +28,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            @Override
-            public Object createNamespaceHandler() {
-                return new SoapBindingBPHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/blueprint/bindings/soap");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                @Override
+                public Object createNamespaceHandler() {
+                    return new SoapBindingBPHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/blueprint/bindings/soap");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/Activator.java
b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/Activator.java
index ee23e69..2ab8004 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/Activator.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/Activator.java
@@ -27,14 +27,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            @Override
-            public Object createNamespaceHandler() {
-                return new ClusteringBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/clustering");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                @Override
+                public Object createNamespaceHandler() {
+                    return new ClusteringBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/clustering");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java
index 0c27236..fc5a5e7 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java
@@ -27,14 +27,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            @Override
-            public Object createNamespaceHandler() {
-                return new JAXRSBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/blueprint/jaxrs");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                @Override
+                public Object createNamespaceHandler() {
+                    return new JAXRSBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/blueprint/jaxrs");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
 
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/Activator.java
b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/Activator.java
index dbaf6f8..8447102 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/Activator.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/blueprint/Activator.java
@@ -27,14 +27,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new JAXWSBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory, "http://cxf.apache.org/blueprint/jaxws");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new JAXWSBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory, "http://cxf.apache.org/blueprint/jaxws");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/Activator.java
b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/Activator.java
index 86c2681..62690b4 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/Activator.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/blueprint/Activator.java
@@ -27,14 +27,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new SimpleBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory, "http://cxf.apache.org/blueprint/simple");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new SimpleBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory, "http://cxf.apache.org/blueprint/simple");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
         
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/Activator.java
b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/Activator.java
index 69ad0b6..246fae1 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/Activator.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/blueprint/Activator.java
@@ -31,14 +31,18 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            @Override
-            public Object createNamespaceHandler() {
-                return new org.apache.cxf.jaxrs.client.blueprint.JAXRSBPNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/blueprint/jaxrs-client");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                @Override
+                public Object createNamespaceHandler() {
+                    return new org.apache.cxf.jaxrs.client.blueprint.JAXRSBPNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/blueprint/jaxrs-client");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/Activator.java
b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/Activator.java
index 71670ee..378109a 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/Activator.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/blueprint/Activator.java
@@ -27,15 +27,19 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new HttpNettyTransportNamespaceHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/transports/http-netty-server/configuration");

+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new HttpNettyTransportNamespaceHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/transports/http-netty-server/configuration");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/blueprint/Activator.java
b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/blueprint/Activator.java
index 226ac60..f1110e2 100644
--- a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/blueprint/Activator.java
+++ b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/blueprint/Activator.java
@@ -27,15 +27,19 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new WsBPHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/ws/addressing"); 
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new WsBPHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/ws/addressing");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/Activator.java
b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/Activator.java
index b11674a..b000a7d 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/Activator.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/blueprint/Activator.java
@@ -27,20 +27,24 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-
-            @Override
-            public Object createNamespaceHandler() {
-                return new PolicyBPHandler();
-            }
-        };
-        NamespaceHandlerRegisterer
-            .register(context, factory, "http://cxf.apache.org/policy", "http://www.w3.org/ns/ws-policy",
-                      "http://www.w3.org/2006/07/ws-policy", "http://schemas.xmlsoap.org/ws/2004/09/policy",
-                      "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
-                      "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
-                      "http://www.w3.org/2000/09/xmldsig#",
-                      "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+    
+                @Override
+                public Object createNamespaceHandler() {
+                    return new PolicyBPHandler();
+                }
+            };
+            NamespaceHandlerRegisterer
+                .register(context, factory, "http://cxf.apache.org/policy", "http://www.w3.org/ns/ws-policy",
+                          "http://www.w3.org/2006/07/ws-policy", "http://schemas.xmlsoap.org/ws/2004/09/policy",
+                          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
+                          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd",
+                          "http://www.w3.org/2000/09/xmldsig#",
+                          "http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cxf/blob/85ad5153/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/Activator.java
----------------------------------------------------------------------
diff --git a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/Activator.java b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/Activator.java
index 258b91a..ad10b1d 100644
--- a/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/Activator.java
+++ b/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/blueprint/Activator.java
@@ -27,16 +27,20 @@ public class Activator implements BundleActivator {
 
     @Override
     public void start(BundleContext context) throws Exception {
-        BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
-            
-            @Override
-            public Object createNamespaceHandler() {
-                return new RMBPHandler();
-            }
-        };
-        NamespaceHandlerRegisterer.register(context, factory,
-                                            "http://cxf.apache.org/ws/rm/manager",
-                                            "http://schemas.xmlsoap.org/ws/2005/02/rm/policy");
+        try {
+            BlueprintNameSpaceHandlerFactory factory = new BlueprintNameSpaceHandlerFactory()
{
+                
+                @Override
+                public Object createNamespaceHandler() {
+                    return new RMBPHandler();
+                }
+            };
+            NamespaceHandlerRegisterer.register(context, factory,
+                                                "http://cxf.apache.org/ws/rm/manager",
+                                                "http://schemas.xmlsoap.org/ws/2005/02/rm/policy");
+        } catch (NoClassDefFoundError error) {
+            // No Blueprint is available
+        }
     }
 
     @Override


Mime
View raw message