ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google

Mail Archive Home | oscar List | January 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Understanding classloaders


I am having a bit of trouble understanding classloaders and am getting a
ClassCastException from one of my third-party dependencies (see below). 

I am using a third-party dependency, Castor, which is included in my
bundle as the regular JAR-file distribution from that project. The JAR
can be found at the top level of my bundle and in any case, I think that
the problem is not locating the class, since I presume that I would get
a CNFE rather than a CCE.

In my bundle, the Castor JAR (and subsequently its dependencies such as
commons-logging below) are being called from com.company.some.package.
This is correctly included with Export-Package in my manifest and
Import-Pacakge in ALL of the bundles that use it, directly or

Castor is included in a bundle (call it "A") that is providing a service
to another bundle ("B"), which itself is providing a service to ("C").

Any ideas about what I need to do to get this right?

Should I pass a different classloader to Castor? If so, from where?

Or, do I need to "export" the Castor JAR from A and import it into B/C
(which to me would seem to be a strange thing to have to do for a 3rd
party dependency...)?

Any advice would be greatly appreciated!

This is the part of the stack trace that shows the CCE:

Caused by: java.lang.RuntimeException: Could not instantiate parser
org.apache.xerces.parsers.SAXParser: java.lang.ClassCastException

<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.