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.
Solved! Go to Solution.
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 -->
Hope this helps.
In Export-Package add org.jsoup.*, it should work.
<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.9.2</version> </dependency>
you can simple copy the bundle jar in your java core project or copy this bundle from core to ui.app similar to app bundle.
I faced similar issue and I am able to solve this. This is because your core bundle is looking for the jsoup bundle and it is missing in out of all of your 600 or 700 available bundles in your aem. So what we have to do is make this bundle available in your AEM.
1. Add jsoup(or any other third party dependencies) dependency in main and core pom.xml.
2. Go to core pom.xml and find the plug-in with artifact id bnd-maven-plugin. Now edit the plugin like below
3. Now save the core pom.xml
4. Now you have to embed this package in ui.all module pom.xml in org.apache.jackrabbit plugin groupID
Note: Change your target folder accordingly to your project.
5. You are done now and deploy the code to your AEM. Now you can see jsoup jar got added into your target folder and if you go to bundles console and search for jsoup then you can see jsoup bundle got added into your aem bundles.
6. Now you can't see jsoup cannot resolve error in your core bundle.
If above steps not works for you then you manually download the related jar present in /apps target folder and try to upload via bundles console. If you get any errors while upload means that your bundle is missing Bundle-SymbolicName or Import-Package or other bundle manifest headers might be missing. In this case you need to manually edit the downloaded bundle via eclipse like converting the jar to osgi bundle in eclipse. There is some process to convert jar into bundle in eclise, google it. While in converting process add the required manifest headers like Import-Package/Export-Package etc.. In Import-Package section if nothing is present in your manifest file then you need to add the required pacakges(take the ref from existing bundle manifest file in your AEM). Putting same version of your jsoup dependency for Import Package is very Important.
See sample core pom.xml: https://github.com/adobe/aem-guides-wknd/blob/main/core/pom.xml
See sample all pom.xml: https://github.com/adobe/aem-guides-wknd/blob/main/all/pom.xml