dynamical class loading

2005-10-12 Thread dumbQuestionsAsker _

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 d’œil : Windows Desktop Search 
http://desktop.msn.fr/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: dynamical class loading

2005-10-12 Thread Yoav Shapira
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]