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

If CXF is last in Karaf feature list, endpoints aren't bound



    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • 2.5
    • NeedMoreInfo
    • OSGi
    • None
    • Talend Service Factory (Karaf 2.2.4, CXF 2.5.0)

    • Unknown


      [I apologize in advance that this bug report has a lot of guesswork in it. I've found a workaround so I've marked this as "Minor", but it took me a week to find my workaround and I can't figure where the root cause is.]

      If I write my "featuresBoot" property in org.apache.karaf.features.cfg like this, everything works:


      But if I (accidentally) move my feature to the front of the list like so:


      then I get 404's for the resources and "No services have been found." on the CXF services list.

      My custom feature contains a JAX-RS application which is bootstrapped with a META-INF/spring/beans.xml file containing beans roughly like this:

      <jaxrs:server id="admin" address="/path/to/my/application">
      <ref bean="traceInboundStart"/>
      <ref bean="traceOutboundDone"/>
      <jaxrs:serviceBeans >
      <ref bean="mySvc"/>
      <ref bean="jaxRsAuthFilter"/>

      Reloading the bundles in "my-custom-feature" fixes the problem (the WADL links appear on the services list and the endpoint URLs respond correctly). In both scenarios ("my-custom-feature" at the front or back of the featuresBoot list), the log messages seem to be nearly identical.

      A really confusing part is that in both cases, I see this log message which seems to suggest success:

      [INFO] Setting the server's publish address to be /path/to/my/application
      logger = org.apache.cxf.endpoint.ServerImpl
      thread = SpringOsgiExtenderThread-2

      So, clearly CXF is getting the JAX-RS application successfully, but somehow that's not being mapped all the way through to the OSGi HTTP service.

      The only other logs that appear relevant appear to be these:

      [INFO] SPI-Provider Manifest header found in bundle: org.apache.cxf.bundle
      [INFO] Binding bundle: [org.apache.cxf.bundle_2.5.0 [191]] to http service

      Those happen just before the "Setting the server's publish address..." message but after the Spring "Found mandatory OSGi service for bean..." resolution messages in the failing scenario.

      I request either 1) a fix so the CXF feature is order independent or 2) a troubleshooting log message to indicate that the resources are bound too late to help others diagnose this problem more quickly.




            Unassigned Unassigned
            cdolan Chris Dolan
            0 Vote for this issue
            2 Start watching this issue