hstaudacher / osgi-jax-rs-connector

An OSGi - JAX-RS 2.0 Connector, software repository available on the link below
http://hstaudacher.github.io/osgi-jax-rs-connector
Other
190 stars 98 forks source link

Swagger throwing NoClassDefFoundError #123

Closed BryanHunt closed 8 years ago

BryanHunt commented 8 years ago

I'm trying to use Swagger in my environment and it's not working. I tracked it down to io.swagger.jackson.ModelResolver line 212. When it tries to load XmlRootElement, you get the NoClassDefFoundError. I use XmlRootElement in another bundle and it seems to work just fine. XmlRootElement for me is defined as part of the rt.jar in the JRE System Library. Any ideas on what is going wrong?

BryanHunt commented 8 years ago

I think I figured out the problem. The Swagger all bundle needs:

Import-Package: javax.xml.bind.annotation

BryanHunt commented 8 years ago

As an experiment, I hacked the swagger all bundle manifest and added javax.xml.bind.annotation to the Import-Package header and it's working now.

hstaudacher commented 8 years ago

ok, any version range we can specify?

BryanHunt commented 8 years ago

I have no idea on version range since it is part of the runtime. I honestly don't fully understand why you even have to import it since it's part of the runtime. Unless there's a definitive answer, I would leave the version range off.

hstaudacher commented 8 years ago

I observed such behaviour earlier. From what I remember such thing shave always worked for me with equinox but for felix (karaf) I had to specify which runtime packages are available to bundles. Does this make sense? It happened a long time ago :)

BryanHunt commented 8 years ago

FYI, I'm using Felix and haven't tried with Equinox.