You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by dumbQuestionsAsker _ <ee...@hotmail.com> on 2005/10/12 11:59:09 UTC
dynamical class loading
hi everybody,
I asked a question on the users mailing list about classloading and someone
advised me to ask it to a tomcat's developper.
So this is my situation :
I got 2 interfaces that have to be loaded dynamically according a request
made to a JSP.
I know the name of the interfaces and by default I have a wrong version of
these interfaces in my WEB-INF/classes/ path.
I tried to load theses interfaces using a URLClassLoader unsuccessfully.
I also tried to replace the .class in WEB-INF/classes/, but the problem is
that the webapp is reloading itself.
Any idea about how to do that?
Is Tomcat able to load classes without reloading the whole webapp or
restarting ?
Thank you in advance and have a nice day.
_________________________________________________________________
Trouvez vos fichiers en un clin dil : Windows Desktop Search
http://desktop.msn.fr/
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
Re: dynamical class loading
Posted by Yoav Shapira <yo...@apache.org>.
Hi,
> I know the name of the interfaces and by default I have a wrong version of
> these interfaces in my WEB-INF/classes/ path.
Don't have a wrong version by default, that's a bad practice.
> I tried to load theses interfaces using a URLClassLoader unsuccessfully.
> I also tried to replace the .class in WEB-INF/classes/, but the problem is
> that the webapp is reloading itself.
Turn off the reloadable property of your webapp by adding reloadable="false" to
the context definition. If you do want to dynamically load classes, just use
Class.forName("my.class.name").
> Any idea about how to do that?
See above.
> Is Tomcat able to load classes without reloading the whole webapp or
> restarting ?
Yes, read the documentation on Class.forName and the context reloadable
property. Once you've done that and/or tried the above, please post further
questions to the tomcat-user mailing list. This list is for Tomcat's internal
development discussions. (You're of course welcome to hang around and chat
here, but only about topics that related to Tomcat's own internal development)
Thank you ;)
Yoav
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org