Been tussling with classloaders and

Been tussling with classloaders and SAX parsers this morning. Class.forName is essentially broken when using modern app. servers with multiple classloaders. Fixed that by using Thread.getCurrentThread().getContextClassloader(). Unfortunately this then broke JUnit with a ClassCastException when using the reloading classloader. Had to add a fallback to the bootstrap classloader to cover both bases.

The implementation of SAX shipped with Java 1.4.0_01 no longer uses class.forName(), which should make life easier.

Advertisements