Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5946

ensure unregister cxf http transport Servlet OSGi service before we re-register it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.1
    • 3.0.2, 3.1
    • None
    • None
    • Unknown

    Description

      In OSGi, when cxf-http-transport configuration get updated from ConfigAdmin service, we re-register cxf http transport Servlet with new configuration props, this can cause two same Servlet instances conflict, which in turn can cause error in pax-web like

      -whiteboard - 3.0.7 | Registration skipped for [ServletWebElement{mapping=DefaultServletMapping{httpContextId=null,urlPatterns=null,initParams={},servlet=org.apache.cxf.transport.servlet.CXFNonSpringServlet@cc5f977, alias=/api, servletNamecxf-osgi-transport-servlet}}] due to error during registration
      javax.servlet.ServletException: servlet already registered with a different alias
              at org.ops4j.pax.web.service.spi.model.ServerModel.addServletModel(ServerModel.java:121)[100:org.ops4j.pax.web.pax-web-spi:3.0.7]
              at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:206)[101:org.ops4j.pax.web.pax-web-runtime:3.0.7]
              at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:189)[101:org.ops4j.pax.web.pax-web-runtime:3.0.7]
              at org.ops4j.pax.web.service.internal.HttpServiceStarted.registerServlet(HttpServiceStarted.java:174)[101:org.ops4j.pax.web.pax-web-runtime:3.0.7]
              at org.ops4j.pax.web.service.internal.HttpServiceProxy.registerServlet(HttpServiceProxy.java:67)[101:org.ops4j.pax.web.pax-web-runtime:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.element.ServletWebElement.register(ServletWebElement.java:61)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElement(WebApplication.java:254)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerWebElements(WebApplication.java:232)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.registerHttpContext(WebApplication.java:223)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:162)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.WebApplication.serviceChanged(WebApplication.java:51)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService.bind(ReplaceableService.java:72)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
              at org.ops4j.pax.web.extender.whiteboard.internal.util.tracker.ReplaceableService$Customizer.addingService(ReplaceableService.java:87)[125:org.ops4j.pax.web.pax-web-extender-whiteboard:3.0.7]
      
      

      Attachments

        Activity

          People

            ffang Freeman Yue Fang
            ffang Freeman Yue Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: