4

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?

David Cain
  • 16,484
  • 14
  • 65
  • 75
KJQ
  • 447
  • 1
  • 7
  • 28

2 Answers2

2

The Maven Sling Plugin allows you to deploy an OSGi bundle to a local or remote running instance of CQ.

Source: Deploying an OSGi Bundle

exception
  • 955
  • 2
  • 11
  • 23
  • Ok, the Sling plugin appears to be what I need to deploy the bundle. I think now the problem I am having is the actual bundle itself. – KJQ Oct 20 '12 at 19:18
0

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.

https://issues.apache.org/jira/browse/SLING-2192 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.

Bertrand Delacretaz
  • 6,100
  • 19
  • 24