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,
