Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] XMLConfigirator: Bug respecting JDK 1.6?

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] XMLConfigirator: Bug respecting JDK 1.6?


Chronological Thread 
  • From: Yang Xiang <>
  • To:
  • Subject: Re: [OpenSAML] XMLConfigirator: Bug respecting JDK 1.6?
  • Date: Mon, 24 May 2010 12:15:16 +0200


Many many thanks for your good explanation. Yes, exactly I have the OpenSAML libraray in the common lib of Tomcat and my classes in the webapps. Meanwhiel I understand the Tomcat's hierarchial classloader a little bit more and I also believe that was not a problem with the loadClass method.

Actually I got a new problem with CastException because I have several webapps with the same classes of mine within one Tomcat. Thus, I'll try to put my SAMLObjects to the common lib folder of Tomcat instead of your suggestion to put the OpenSAML library to my web application folder, because I have to run serveral applications within the same Tomcat as mentioned above.

I hope and believe this will solve my problem for now. Thanks again!


在 2010-5-21,下午9:22, Brent Putman 写道:



On 5/21/2010 6:45 AM, Yang Xiang wrote:
I wrote an extension to the XMLConfigurator by overwritng the method
createClassInstance and replacing the line:

Class clazz = classLoader.loadClass(className);

with

Class clazz = Class.forName(className, false, classLoader);

Now it works fine with tomcat too.




And that almost certainly means that this is an issue with Tomcat's
hierarchial classloader. You don't say which Classloader you are using
as the classLoader in the call to Class.forName there, but if it's
either your configurator class's classloader
(this.getClass().getClassloader() ) or the current Thread context
classloader (which I believe in a webapp would be the same classloader),
then that would explain it. The classloader looks first to itself and
then delegates to its parent, and since your XMLObject code is probably
in your webapp, then it finds it.




Archive powered by MHonArc 2.6.16.

Top of Page