karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioan Eugen Stan <stan.ieu...@gmail.com>
Subject Re: Karaf 2.3.2: ClassNotFoundException for javax.* packages
Date Fri, 16 Aug 2013 12:01:17 GMT
Hello JB,

I think Freeman is right. I will explain my setup here:

I have a bundle that uses Jasper to create PDF's. The Jasper bundle
I'm using (5.1.0 from Maven Central) depends on Xerces libraries but
declares Dynamic-Imports, not explicit imports.
Because Karaf does not export the xerces packages from lib/endorsed I
have to add the xerces bundle. I'm also using XML parsers from
javax.xml.* packages, implemented by xerces from lib/endorsed.

The issue arises from the fact that during PDF generation, classes
from my own xerces bundle get mixed with classes from javax.xml system
bundle implemented by the lib/endorsed xerces. Since they are loaded
by different ClassLoaders it results in a ClassCast exception. I think
the solution is, as Freeman suggested to export the xerces packages
from the lib/endorsed version. That way the calsses will be loaded
from the same bundle, by the same ClassLoader.

I'm willing to test this if you tell me what to do. I'm not that deep
in Karaf yet, and no time to get deep right now.

Regards,

Mime
View raw message