AEM Version 6.2 Problem in creating OSGI Bundle | Community
Skip to main content
vishalk78125371
New Participant
July 19, 2017
Solved

AEM Version 6.2 Problem in creating OSGI Bundle

  • July 19, 2017
  • 4 replies
  • 1933 views

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.

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 vishalk78125371

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,

4 replies

vishalk78125371
vishalk78125371AuthorAccepted solution
New Participant
July 20, 2017

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,

smacdonald2008
New Participant
July 19, 2017

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.

Techaspect_Solu
New Participant
July 19, 2017

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/

zeeshanKhan0786
New Participant
July 19, 2017

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