Expand my Community achievements bar.

SOLVED

Jsoup jar does not installed in OSGi Bundle

Avatar

Level 3

Hello Community!

For the better understanding of OSGi and Sling Model, I was working on this tutorial Adobe Experience Manager Help | Creating a HTML Template Language and Sling Model DOM parser compone...

At the Deploy the bundle to AEM section, I have a problem install Jsoup.

On the note, If  I get error message at JSoup, I need to remove version from Manufest file so I did.

However, I still have problem install the Jsoup

1317329_pastedImage_1.png

I have jsoup in pom.xml file as its dependency

1317330_pastedImage_2.png

Also I could see the jar file under Maven Dependencies

1317331_pastedImage_3.png

Does anybody know what I make mistake ?

Thanks!

Ryu

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Even if you have included dependency

1317966_pastedImage_0.png

You have to add the JSOUP JAR to AEM as well. See the below screenshot and steps to follow in the article.

1317990_pastedImage_1.png

Hope this helps!!

~Ratna

View solution in original post

8 Replies

Avatar

Community Advisor

For any 3rd party Jar(not provided by the Felix container), you need to bundle it and send or embed it in your current bundle. Take a look at java - OSGI - handling 3rd party JARs required by a bundle - Stack Overflow . It talks about similar thing.

Hope this helps..

Avatar

Correct answer by
Level 10

Hi,

Even if you have included dependency

1317966_pastedImage_0.png

You have to add the JSOUP JAR to AEM as well. See the below screenshot and steps to follow in the article.

1317990_pastedImage_1.png

Hope this helps!!

~Ratna

Avatar

Level 4

What are steps 8 and 9? From the screen-shot it looks to be cropped. Please share further steps.

Avatar

Level 3

Hello Everyone!

Thanks to all the replay. I could resolved the problem.

I installed individual jsoup jar to AEM, and removed all the version number from Manifest file.

Cheers!

Ryu

Avatar

Level 1

We had to more to get JSoup working in our project  for AEM 6.3 -- alot more.  Here is an extract from our pom.xml(It may not be complete, notice we had to pull down the libraries manually to make things work.):

<properties>

   ...

   <system.dependencies>${project.basedir}/lib</system.dependencies>

</properties>

<dependencyManagement>

   <dependencies>

   <dependency>

...

<dependency>

   <groupId>org.apache.tapestry</groupId>

   <artifactId>tapestry-json</artifactId>

   <version>5.4.1</version>

   <type>jar</type>

   <scope>system</scope>

   <systemPath>${system.dependencies}/org.apache.tapestry-5.4.1.jar</systemPath>

</dependency>

...

<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>

   <groupId>org.jsoup</groupId>

   <artifactId>jsoup</artifactId>

   <version>1.10.3</version>

   <type>jar</type>

   <scope>system</scope>

   <systemPath>${system.dependencies}/jsoup-1.10.3.jar</systemPath>

</dependency>

<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>

   <groupId>com.google.code.gson</groupId>

   <artifactId>gson</artifactId>

   <version>2.8.1</version>

   <type>jar</type>

   <scope>system</scope>

   <systemPath>${system.dependencies}/gson-2.8.1.jar</systemPath>

</dependency>

...

</dependencies>

</dependencyManagement>

Avatar

Level 4

Hi Ratnakumar,

 

What are steps 8 and 9? From the screen-shot it looks to be cropped. Please share further steps.