How to deploy and access a Jersey REST OSGi bundle into Adobe CQ?

By : KJQ

I have an OSGi bundle (running under Felix) using Jersey and providing a RESTful resource. This all works fine and I can invoke the service through my browser and get back a JSON response.

Now, what I would like to do is deploy that same bundle into Adobe CQ and through CQ access the resource (i.e. /mycq/services/my-service) similarly.

Any pointers on how to deploy an existing OSGi bundle(s) into CQ and more specifically 'access' the Jersey REST resource in the bundle?

By : KJQ


Apache Stanbol is using Jersey in an OSGi environment that's fairly similar to Apache Sling's on which CQ5 is based. Looking at how Jersey is integrated there might help. also has some experimental code that might help.

Note that Sling expects to take over the whole URI space, which is needed especially for access control, so some bridging code is probably needed.

This video can help you solving your question :)
By: admin