Expand my Community achievements bar.

SOLVED

Getting javax.ws.rs -- Cannot be resolved

Avatar

Level 3

Hi All,

I'm trying to make one custom rest service using jersey, but when deploying bundle on AEM 6.2 getting following error:Capture.PNG

I added following dependency in pom.xml file of core project:

<dependency>

  <groupId>com.sun.jersey</groupId>

  <artifactId>jersey-core</artifactId>

  <version>1.12</version>

  </dependency>

  <dependency>

  <groupId>com.sun.jersey</groupId>

  <artifactId>jersey-server</artifactId>

  <version>1.12</version>

  </dependency>

Please give me solution or can you give me one example how to create custom rest service without servlet in aem

Please help me i'm new with aem and doing this thing first time.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi Anil

         Adding to Jorg's point,  When a bundle is installed in to Felix console, it will try to resolve all the dependencies mentioned, by matching it with an available bundle in the FELIX CONSOLE.

For eg :- If you see your bundle

1287542_pastedImage_0.png

          This says that the javax.annotation (this shud be a depenedency added in your pom.xml) is imported from a bundle org.apcahe.felix.framework

     So that means , when your bundle is installed into Felix console, it will resolve each dependency from an available bundle in the console

In your case , when your bundle was deployed , there is no bundle which has below API's exposed for use.

1287543_pastedImage_1.png

In that case , below are the two solutions I would suggest (I am sure there should be more solutions )

    

1. If you have an OSGI bundle available for above jars, install that to your Felix console and you should be good to go

2. If no OSGI bundle is available, download the jars and make an OSGI bundle using eclipse plugin manager and deploy it to the felix console

Hope this helps !!

Thanks

Veena

View solution in original post

3 Replies

Avatar

Employee Advisor

You added the dependencies to the POM, which is used during build/testing, and the bundle declares the correct dependencies.

But your AEM instance cannot provide these dependencies (that means, you don't have JAX-RS bundles deployed). What libs implementing JAX-RS do you want to use?

Jörg

Avatar

Correct answer by
Community Advisor

Hi Anil

         Adding to Jorg's point,  When a bundle is installed in to Felix console, it will try to resolve all the dependencies mentioned, by matching it with an available bundle in the FELIX CONSOLE.

For eg :- If you see your bundle

1287542_pastedImage_0.png

          This says that the javax.annotation (this shud be a depenedency added in your pom.xml) is imported from a bundle org.apcahe.felix.framework

     So that means , when your bundle is installed into Felix console, it will resolve each dependency from an available bundle in the console

In your case , when your bundle was deployed , there is no bundle which has below API's exposed for use.

1287543_pastedImage_1.png

In that case , below are the two solutions I would suggest (I am sure there should be more solutions )

    

1. If you have an OSGI bundle available for above jars, install that to your Felix console and you should be good to go

2. If no OSGI bundle is available, download the jars and make an OSGI bundle using eclipse plugin manager and deploy it to the felix console

Hope this helps !!

Thanks

Veena