Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

JSOUP not getting resolved

Avatar

Level 3

Hello All - I am getting the below error because of that, OSGi bundle is not starting.

 

org.jsoup,version=[1.9,2) -- Cannot be resolved
org.jsoup.nodes,version=[1.9,2) -- Cannot be resolved
org.jsoup.select,version=[1.9,2) -- Cannot be resolved

 

Basically I just wanted to include JSOUP jar that should be embedded in my project's bundle. I tried adding the below to include the JSOUP in the bundle. I am using latest archetype (23), Can someone advise on how to include the embed the bundle.

Also please note that, I have already placed the required JSOUP jar in the "libs" folder.


<properties>
<system.dependencies>${project.basedir}/libs</system.dependencies>
</properties>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.9.2</version>
<type>jar</type>
<scope>system</scope>
<systemPath>${system.dependencies}/jsoup-1.9.2.jar</systemPath>
</dependency>


<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.1.0</version>
<inherited>true</inherited>
<configuration>
<instructions>
<Bundle-SymbolicName>com.test.core</Bundle-SymbolicName>
<Sling-Model-Packages>
com.test.core.internal.impl.models
</Sling-Model-Packages>
<Embed-Dependency>jsoup</Embed-Dependency>
</instructions>
</configuration>
</plugin>

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
13 Replies

Avatar

Community Advisor

Hi @s1101v,

 

The below error says that the JSOUP bundle is not resolved. To resolve the issue, check my answer here.

 

If you are trying to include JSOUP Jar, AEM does not support it. You need to install a bundle into AEM. Use this dependency in your pom and follow the steps mentioned in the above link.

 

<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
</dependency>

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Level 3
@Kiran_Vedantam - I have already tried this as well. This jar needs to be included in my project's bundle so I added <Embed-Dependency> in core module POM but it is not including in the bundle.

Avatar

Community Advisor
Hi s1101v, please add it in the install folder of the instance to check if it gets installed

Avatar

Level 3
@Kiran_Vedantam - I have installed the bundle in the instance as well. I still see issues with the JSOUP bundle. I have extracted the project bundle as well, the included jar is not available.

Avatar

Community Advisor

@s1101v 

In Export-Package add org.jsoup.*, it should work.

<dependency>
    <groupId>org.jsoup</groupId>
    <artifactId>jsoup</artifactId>
    <version>1.9.2</version>
</dependency>
<Export-Package>org.jsoup.*</Export-Package>

Avatar

Community Advisor

@s1101vDid you remove Embed-Dependency? If no remove it. Add remove system scope also. Check in Exported Packages list.

jsoup.PNG

Avatar

Level 3
@Anudeep_Garnepudi - I have already removed scope, systempath and also embed-dependency as well. I see the issue in "Import Packages" section, so I have added <Import-Package>org.jsoup.*</Import-Package>. The bundle is not getting resolved.

Avatar

Correct answer by
Community Advisor

Avatar

Level 3
@arunpatidar - I have already gone through this link. If I add/install the jsoup jar separately in console, the bundle gets resolved but I don't want to install the required bundles separately. Basically I just wanted to include it in project bundle itself. I am getting the error in "Import Packages" section.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now