I created a simple example to reproduce the error.
JAX-RS Swagger2Feature OSGI Issue
This example is based on the code from
How to reproduce the issue:
mvn install (on the example)
bin/karaf (I used the current karaf 4.0.5)
feature:repo-add cxf 3.1.6
install -s mvn:de.kreeloo/cxf-swagger2-osgi-api/1.0.0
install -s mvn:de.kreeloo/cxf-swagger2-osgi-impl/1.0.0
It may happen that one component is complaining about a missing guava class even if you provided it before. All you have todo is copy guava-18.jar into your deploy folder. I think this is a karaf bug. I have to create a ticket for. After you place the guava file into your deploy folder and type list, all bundles should be active.
Now open your web browser and type:
And all you see is the swagger header.
I guess the problem is the ClasspathHelper.class from org.reflections it looks like that this one is not able to access the osgi component.
The behavior is similar to this error description: