Back in January 2012, I wrote about the release of the OSGi JAX-RS connector in version 1.0. The connector gives you the opportunity to publish resources by registering
@Path annotated types as OSGi services. I’m glad to say that the connector is in production use in many projects. It is pretty stable and as a result there was not much need for maintenance. So, why release a version 2.0? A few weeks ago I wanted to provide a small REST API using Apache Karaf as runtime. For this I also wanted to use the JAX-RS connector. Unfortunately, I had to accept that the connector was not able to run on Karaf and Felix because of certain issues.
I had to rework some of the connector internals and update the Jersey bundles to 1.13.0 to make it work. But, internal rework is no reason for a 2.0, right? Unless, during the rework something results in a breaking change. In version 1.0 of the connector all resources were registered on
/. Sadly, this is not possible using Karaf and it’s HTTPService implementation. Therefore, the new root path of the registered resources is
/services. The good news is that it’s configurable . You can use the config admin to change the root path. For this the service.pid is
com.eclipsesource.jaxrs.connector. The only property supported is
root which needs to be a valid path (like with servlets, it has to begin with
To put it all together, the internal rework, the Jersey update and the new path gave me reason to bump it to 2.0 to make the breaking change visible. I hope you like the new version. As a reminder here are the most important resources:
GitHub repository: https://github.com/hstaudacher/osgi-jax-rs-connector
p2 repository: http://hstaudacher.github.com/osgi-jax-rs-connector
As always, feel free to comment .