OSGi package dependencies not getting resolved | Community
Skip to main content
Level 4
October 16, 2015
Solved

OSGi package dependencies not getting resolved

  • October 16, 2015
  • 4 replies
  • 2726 views

Hi,

I am trying to use Jsoup library by creating an OSGi bundle out of it. I have created the bundles before so I am pretty much familiar with the process. I have also added the dependencies in the pom.xml like this: 

<dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.3</version> </dependency> 

I am also following the steps given here: https://helpx.adobe.com/experience-manager/using/html-parser-service.html

I have tried everything but still the dependencies are not getting resolved. Attached are the screenshots.

What do I do ?

Thanks in advance

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 smacdonald2008

OPen the OSGi bundle in a tool like WInRAR:

[img]JSOUP.png[/img]

Extract and open the MF file. Remove the version information -- so it looks like:

[img]JSOUP2.png[/img]

Notice that there are no version information. Ensure a comma separetes the packages in the import section of the MF file. 

After you modify the MF file, place it back into the OSGi bundle in the same location. 

4 replies

Level 3
October 16, 2015

the bundle that is installed is version 1.0.0, your code is using version 1.7.2. I suppose this is why dependencies are not resolved.

Lokesh_Shivalingaiah
Level 10
October 16, 2015

Two things you can do

1. In your dependency change the version from 1.7.3 to 1.0.0 and it should resolve the issue as mentioned by @awedesh. 

2. If you want to use the latest Jsoup, then dont install the JsoupBundle as mentioned in the article, instead include this latest version of jsoup jar in your bundle directly. 

Level 4
October 16, 2015

The issue that I am facing is that the export package in json bundle are being exported as version 0.0.0. I have tried creating bundles out of jsoup library jar for every version from 1.7.2 to the latest 1.8.2 but I am still getting the same error. 

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

OPen the OSGi bundle in a tool like WInRAR:

[img]JSOUP.png[/img]

Extract and open the MF file. Remove the version information -- so it looks like:

[img]JSOUP2.png[/img]

Notice that there are no version information. Ensure a comma separetes the packages in the import section of the MF file. 

After you modify the MF file, place it back into the OSGi bundle in the same location.