« Return to Thread: Using spec JARs for bundled class library packages can be problematic (ClassCastException)

Using spec JARs for bundled class library packages can be problematic (ClassCastException)

by Jeremias Maerki-2 :: Rate this Message:

Reply to Author | View in Thread

I'm just posting this in case anyone else runs into a similar problem.
I'm running Karaf/Felix and a bundle is using ImageIO (javax.imageio) to
access the metadata of a bitmap image. Internally, ImageIO uses the W3C
DOM API for representing metadata. I ran into a ClassCastException for
org.w3c.dom.Element because the client bundle's DOM was coming from the
ServiceMix JAXP spec JAR but ImageIO used its own bundled JAXP packages.

I had to remove the spec JAR in favor of boot delegation for the basic
XML-related APIs. That solved the problem. I hope I won't run into any
negative effects from that later on. Fingers crossed.

Of course, another solution would be to have an ImageIO bundle. Too bad
Harmony's implementation isn't complete, yet.

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

 « Return to Thread: Using spec JARs for bundled class library packages can be problematic (ClassCastException)