Getting javax.ws.rs -- Cannot be resolved | Community
Skip to main content
Level 2
August 26, 2017
Solved

Getting javax.ws.rs -- Cannot be resolved

  • August 26, 2017
  • 3 replies
  • 16576 views

Hi All,

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

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by VeenaVikraman

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

          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.

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

3 replies

Prince_Shivhare
Community Advisor
Community Advisor
August 27, 2017

try to add the dependency in Project POM file accordingly.

Also check below articles for your reference:

Adobe Experience Manager Help | Creating Adobe Experience Manager bundles that invoke third party Restful web services

Creating an Experience Manager YouTube Component

Regards,
Prince

joerghoh
Adobe Employee
Adobe Employee
August 27, 2017

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

VeenaVikraman
Community Advisor
VeenaVikramanCommunity AdvisorAccepted solution
Community Advisor
August 28, 2017

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

          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.

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