Issue with getting Swagger working with cxfrs

Solution Verified - Updated -

Issue

  • We have hosted few of the rest services using camel cxfrs and now we are planning to use swagger for api doc generation.
    Going by the cxfrs documentation, all we need is to add swagger feature bean as a cxf feature to the cxfrs endpoint.

First point which we notice is that we cannot find org.apache.cxf.jaxrs.swagger.Swagger2Feature class . Is this not available with fuse 6.1 ?

  • We then moved to SwaggerFeature instead and finally we end up with the following error.
Caused by: java.lang.ClassNotFoundException: com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON not found by org.apache.cxf.cxf-rt-frontend-jaxrs [182]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)

  • We have got swagger feature installed and we can see this class is available in fuse.
JBossFuse:karaf@root> find-class ApiListingResourceJSON

Apache ServiceMix :: Bundles :: swagger-jaxrs_2.10 (379)
com/wordnik/swagger/jaxrs/listing/ApiListingResourceJSON.class

But looks like somehow org.apache.cxf.cxf-rt-frontend-jaxrs is not able to see ApiListingResourceJSON

Environment

  • Red Hat JBoss Fuse
    • 6.1.x
  • Apache CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content