You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2017/10/11 11:30:29 UTC

[cxf] branch 3.1.x-fixes updated (f150b0d -> 9b76aef)

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a change to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from f150b0d  Merge pull request #313 from johnament/CXF-7493
     new 920f19c  [CXF-7528] Tone down logging when unregistering CXF servlet in OSGi during fast reprovisioning
     new 9b76aef  [CXF-7529] Clean up JAX-RS RuntimeDelegate when rt-frontend-jaxrs bundle is stopped/refreshed

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/cxf/jaxrs/blueprint/Activator.java |  4 +++-
 .../cxf/transport/http/osgi/ServletExporter.java       | 18 +++++++++++++++++-
 2 files changed, 20 insertions(+), 2 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].

[cxf] 01/02: [CXF-7528] Tone down logging when unregistering CXF servlet in OSGi during fast reprovisioning

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 920f19caf55807a2d008721273b567b62de98f4c
Author: Grzegorz Grzybek <gr...@gmail.com>
AuthorDate: Wed Oct 11 08:26:42 2017 +0200

    [CXF-7528] Tone down logging when unregistering CXF servlet in OSGi during fast reprovisioning
    
    (cherry picked from commit 1d7eeaeb029ab6fed299ff8c91084dc11c069f8b)
---
 .../cxf/transport/http/osgi/ServletExporter.java       | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
index 867dca1..25c03e3 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/ServletExporter.java
@@ -51,7 +51,22 @@ class ServletExporter implements ManagedService {
     @Override
     public void updated(Dictionary properties) throws ConfigurationException {
         if (alias != null) {
-            httpService.unregister(alias);
+            try {
+                LOG.log(Level.INFO, "Unregistering previous instance of \"" + alias + "\" servlet");
+                httpService.unregister(alias);
+            } catch (IllegalArgumentException e) {
+                // NOTE: pax-web specific...
+                if (e.getMessage() != null && e.getMessage().contains("was never registered")) {
+                    LOG.log(Level.INFO, "CXF OSGi servlet was not unregistered: " + e.getMessage());
+                } else {
+                    LOG.log(Level.SEVERE, e.getMessage(), e);
+                }
+                if (properties == null) {
+                    // we're simply stopping. if we couldn't unregister, that means we had to little time to register
+                    // otherwise, we'll try to register the servlet
+                    return;
+                }
+            }
             alias = null;
         }
         if (properties == null) {
@@ -105,6 +120,7 @@ class ServletExporter implements ManagedService {
         alias = (String)getProp(properties, CXF_SERVLET_PREFIX + "context", "/cxf");
         HttpContext context = httpService.createDefaultHttpContext();
         try {
+            LOG.log(Level.INFO, "Registering new instance of \"" + alias + "\" servlet");
             httpService.registerServlet(alias, servlet, sprops, context);
         } catch (Exception e) {
             LOG.log(Level.WARNING, "Error registering CXF OSGi servlet " + e.getMessage(), e);

-- 
To stop receiving notification emails like this one, please contact
"commits@cxf.apache.org" <co...@cxf.apache.org>.

[cxf] 02/02: [CXF-7529] Clean up JAX-RS RuntimeDelegate when rt-frontend-jaxrs bundle is stopped/refreshed

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 9b76aef2d2753bce5edd5205b35ae0742a63bd6d
Author: Grzegorz Grzybek <gr...@gmail.com>
AuthorDate: Wed Oct 11 08:45:52 2017 +0200

    [CXF-7529] Clean up JAX-RS RuntimeDelegate when rt-frontend-jaxrs bundle is stopped/refreshed
    
    (cherry picked from commit a3bd3655a9000911c3f7da431e5f215a2fd348aa)
---
 .../jaxrs/src/main/java/org/apache/cxf/jaxrs/blueprint/Activator.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 fc5a5e7..768fc9e 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
@@ -18,6 +18,8 @@
  */
 package org.apache.cxf.jaxrs.blueprint;
 
+import javax.ws.rs.ext.RuntimeDelegate;
+
 import org.apache.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory;
 import org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer;
 import org.osgi.framework.BundleActivator;
@@ -44,7 +46,7 @@ public class Activator implements BundleActivator {
 
     @Override
     public void stop(BundleContext context) throws Exception {
-
+        RuntimeDelegate.setInstance(null);
     }
 
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@cxf.apache.org" <co...@cxf.apache.org>.