You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by aps337 <ap...@gmail.com> on 2016/08/09 19:47:54 UTC

Swagger JAXRS Project in Karaf

I have a Swagger (OpenAPI) specification based project that I want to create
an OSGI bundle for. The OpenAPI tool suite includes a code generator which
generates a maven based web services project which can be run from Jetty. I
want to run this project in Karaf 3.0.7. I have gone in circles for far more
time than I care to admit trying to get this working.

I have hosted the project on github for ease of sharing here:

https://github.com/aps337.swagger-osgi

If you clone this, and then do a mvn jetty:run and then go to
http://localhost:8080/v1/bars you'll get this json blob:
{"code":4,"type":"ok","message":"magic!"}

This project is the base generated code, all of my attempts to make this
work in Karaf have been unsuccessful so I am disinclined to steer folks in
the wrong direction.

Conceptually, I know that I need to add felix maven bundle plugin. I'm able
to do that and get a valid OSGI bundle, but when I do this, and then peel
back the layers of ClassNotFound exceptions (by adding them to import list)
I end up with one of two things, either a bundle that successfully gets
loaded but endpoints of API don't work or MessageBodyWriter not found error
(and commensurate 500 error). 

I see discussion of bundleactivators and extending application but since
this all works in jetty as is, seems like the changes should be 'trivial' to
make this work in karaf, no? 

Can someone help me with a pom.xml and whatever other minimal changes are
necessary to get this working in karaf? 




--
View this message in context: http://karaf.922171.n3.nabble.com/Swagger-JAXRS-Project-in-Karaf-tp4047475.html
Sent from the Karaf - User mailing list archive at Nabble.com.