Expand my Community achievements bar.

SOLVED

JWT is not resolved in AEM 6.2

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

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.

Avatar

Level 10

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.

Avatar

Level 10

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.

Avatar

Level 3

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