Expand my Community achievements bar.

SOLVED

AEM Version 6.2 Problem in creating OSGI Bundle

Avatar

Level 2

Hello Friends

I have created an OSGI bundle for AEM from eclipse .

Once we load the bundle the bundle does not move to Active state .

I can see the following errors mentioned in the OSGI bundle highlighted in RED

javax.xml,version=1.3.0 -- Cannot be resolved

javax.xml.namespace,version=1.3.0 -- Cannot be resolved

javax.xml.parsers,version=1.3.0 -- Cannot be resolved

javax.xml.transform,version=1.3.0 -- Cannot be resolved

javax.xml.transform.dom,version=1.3.0 -- Cannot be resolved

javax.xml.transform.sax,version=1.3.0 -- Cannot be resolved

javax.xml.transform.stream,version=1.3.0 -- Cannot be resolved

org.w3c.dom,version=3.0.0 -- Cannot be resolved

org.xml.sax,version=2.0.2 -- Cannot be resolved

We I go to the dependency finder I can see that the artifact already present .

<dependency>

<groupId>org.apache.sling</groupId>

<artifactId>org.apache.sling.fragment.xml</artifactId>

<version>1.0.2</version>

<scope>provided</scope>

</dependency>

When I remove the dependencies from the Imported Packages section of the manifest I receive the No class Found Exception for one of these jars.

Kindly advise.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks All for responding to the thread .

I was able to fix the problem by removing the attribute version from every package in the manifest file and then loading the OSGI bundle .

Old :

javax.xml,version=1.3.0

javax.xml.namespace,version=1.3.0

javax.xml.parsers,version=1.3.0

javax.xml.transform,version=1.3.0

javax.xml.transform.dom,version=1.3.0

javax.xml.transform.sax,version=1.3.0

javax.xml.transform.stream,version=1.3.0

org.w3c.dom,version=3.0.0

org.xml.sax,version=2.0.2

New :

javax.xml,

javax.xml.namespace,

javax.xml.parsers,

javax.xml.transform,

javax.xml.transform.dom,

javax.xml.transform.sax,

javax.xml.transform.stream,

org.w3c.dom,

org.xml.sax,

View solution in original post

4 Replies

Avatar

Level 5

Hi

Did you try after adding the same version dependency in the pom.xml file.

It is version problem your Xml package is having version 1.3.0 when i saw into the aem same xml package having 2.1.0 version.

try to replace with the dependency in pom.xml with you find in dep finder.

Thanks

Avatar

Level 7

Hi vishalk78125371,

This kind of issues occurs when there is a mismatch with dependency versions.I would suggest you to add uber jar along with the above mentioned "org.apache.sling.fragment.xml" artifact dependency.

Try adding below dependency in parent pom

        <dependency>

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

            <artifactId>uber-jar</artifactId>

            <version>6.2.0</version>

            <scope>provided</scope>

            <classifier>apis</classifier>

        </dependency>

and add below dependency in the core pom

        <dependency>

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

            <artifactId>uber-jar</artifactId>

            <classifier>apis</classifier>

        </dependency>

                

Thank you,

Techaspect Solutions.

http://www.techaspect.com/

Avatar

Level 10

Try building OSGi using Maven 10 Archetype and Uber Jar - see:

Scott's Digital Community: Creating your first AEM 6.2 Project using Adobe Maven Archetype 10

Best practice working with AEM is to use Uber JAR.

Avatar

Correct answer by
Level 2

Thanks All for responding to the thread .

I was able to fix the problem by removing the attribute version from every package in the manifest file and then loading the OSGI bundle .

Old :

javax.xml,version=1.3.0

javax.xml.namespace,version=1.3.0

javax.xml.parsers,version=1.3.0

javax.xml.transform,version=1.3.0

javax.xml.transform.dom,version=1.3.0

javax.xml.transform.sax,version=1.3.0

javax.xml.transform.stream,version=1.3.0

org.w3c.dom,version=3.0.0

org.xml.sax,version=2.0.2

New :

javax.xml,

javax.xml.namespace,

javax.xml.parsers,

javax.xml.transform,

javax.xml.transform.dom,

javax.xml.transform.sax,

javax.xml.transform.stream,

org.w3c.dom,

org.xml.sax,