Question

I have an ear application deployed to liberty profile. And I also have OSGi bundles as product extensions (deployed in /wlp/usr/extension..)

In one of the OSGi bundles, it refers to classes in the xml.jar of jre runtime. (i.e org.apache.xpath.XPathParser or javax.xml.parsers.DocumentBuilderFactory). At run time, I encountered ClassNotFoundException when these parts of code invoked.

I tried to Import-Package of these classes in the OSGi's bundle MANIFEST file. But then my bundle will fail to load when liberty starts. Error in trace.log says that the imported package (i.e org.apache.xpath) is missing.

Is there a limitation on liberty side on the use of jre 's library? Any idea of what is wrong ?

Thank you very much.

Was it helpful?

Solution

Importing the packages in the bundle manifests is the right thing to do. The fact that the bundles don't start is the system's way of telling you early that there's a problem. You may need to explicitly include the Apache xpath libraries in your product extension, since Apache classes are not shipped in the JRE's xml.jar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top