JWT is not resolved in AEM 6.2 | Community
Skip to main content
Level 3
April 18, 2018
Solved

JWT is not resolved in AEM 6.2

  • April 18, 2018
  • 5 replies
  • 5013 views

Hi,

I am creating json web token (JWT) osgi service in AEM 6.2. The build is successful but since  io.jsonwebtoken is not resolved my osgi bundle is in Installed state.

(io.jsonwebtoken,version=[0.6,1) -- Cannot be resolved)

I have added the following dependencies, but still i am getting the error.

<dependency>

    <groupId>io.jsonwebtoken</groupId>

    <artifactId>jjwt</artifactId>

    <version>0.6.0</version>

    <scope>provided</scope>

  </dependency>

  <dependency>

          <groupId>com.fasterxml.jackson.core</groupId>

          <artifactId>jackson-databind</artifactId>

          <version>2.8.2</version>

          <scope>provided</scope>

</dependency>

            <dependency>

            <groupId>org.apache.geronimo.specs</groupId>

            <artifactId>geronimo-atinject_1.0_spec</artifactId>

            <version>1.0</version>

            <scope>provided</scope>

        </dependency>

            <dependency>

    <groupId>com.adobe.aem</groupId>

    <artifactId>uber-jar</artifactId>

    <version>6.2.0</version>

    <scope>provided</scope>

    <classifier>obfuscated-apis</classifier>

</dependency>

Could anyone help me on this issue.

Thanks in advance.

Divya

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 smacdonald2008

Two things to make an API work in AEM

1 - when building an OSGi that makes use of a Java API - you need to reference the Java API in your POM file (you did this)

2 - there needs to be an OSGi bundle in AEM that exposes this API. (This is not the case here)

Its because of 2 that you are experiencing an issue.

5 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
April 18, 2018

Two things to make an API work in AEM

1 - when building an OSGi that makes use of a Java API - you need to reference the Java API in your POM file (you did this)

2 - there needs to be an OSGi bundle in AEM that exposes this API. (This is not the case here)

Its because of 2 that you are experiencing an issue.

smacdonald2008
Level 10
April 18, 2018

YOu need to get a JAR file that contains this Java package. Then you need to package it into an OSGi bundle and deploy the bundle to AEM and place it into an Active State.

Ratna_Kumar
Level 10
April 18, 2018

Hi Divya,

Yes Scott is right. You need to get JAR file and package it into OSGI bundle and deploy and then it will be in Active State.

I too seen that you have been referenced Java API in your POM file and you missed the OSGI bundle that exposes your Java API.

Thanks,

Ratna.

Level 3
April 19, 2018

Thank you. I have added corresponding jar files in OSGi and this issue is resolved.

smacdonald2008
Level 10
April 19, 2018

I am glad to hear that!