We use the little "manager" servlet/application. As I recall there is a pretty good 
"HowTo" on it for Tomcat 4.

-----Original Message-----
From: Denise Mangano [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 21, 2003 11:12 AM
To: 'Tomcat Users List'
Subject: RE: [beginner question] reloading classes


Sorry to sneak the question into this post, but is stopping and starting the
service the only way to get the class reloaded?  For example, my java and
class files are in
TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/com/complusdata/beans/ and there is
nothing in here is nothing in TOMCAT_HOME/common/classes/ so I would imagine
the higher classloader scenario you gave wouldn't apply...

Why is it then that whenever I make a change to my java file and recompile,
I have to restart Tomcat in order for the changes to take effect.  Is there
a better way to do this?

Thanks :)

Denise 


-----Original Message-----
From: Jeremy Nix [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 21, 2003 12:53 PM
To: Tomcat Users List
Subject: RE: [beginner question] reloading classes


If you're stopping and starting tomcat and seeing that the change has not
been picked up, then you're experiencing a classloader issue where that
class is being picked up in a higher classloader before your version of that
class is.

For instance:
TOMCAT_HOME/webapps/your_app/WEB-INF/classes/com/example/MyClass.class
TOMCAT_HOME/common/classes/com/example/MyClass.class

The 2nd one would be loaded prior to first because it will be loaded in a
higher classloader.

As for the touching of the web.xml file to reload the class.  This only
works for classes loaded in the web application's classloader, and not for
classes loaded within tomcat's internal classloader.  I don't have the
specific Tomcat classloader hierarchy on hand, but I can tell you that a
change made outside the context of your app to a class loaded within
common/lib or server/lib requires a restart of Tomcat.

_________________
Jeremy Nix
Senior Application Developer
Southwest Financial



-----Original Message-----
From: Jacques Capesius [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 21, 2003 12:31 PM
To: 'Tomcat'
Subject: [beginner question] reloading classes


Hi folks,

I'm new to Tomcat, but not as new to J2EE. I have a jsp, and I made a change
to a class that's being loaded into it as a bean, but I can't get the page
to use the new class and not the old one. 

My question, thus, is: when I make changes to a class, how do I get Tomcat
to reload the class?

Restarting Tomcat doesn't seem to do the trick. 

Searching the web, I found a doc that made mention that "touching" the
web.xml file would force the reloading of the class. I tried that and it
didn't work.

I also read somewhere that going to the application (where the JSPs are) and
typing ANT would force the recompile of everything. Still, the old class is
being used.

I'm storing the class in %catalina_home%/classes/PSQ/. I'm loading it into
the jsp by means of the following line of code:

<jsp:useBean id="psq" class="PSQ.PSQ" scope="session"/>

I've made sure there are no other versions of PSQ.class in any other places
it might be used, for example, the WEB-INF/classes directory.

Thanks for whatever advice you can give, and I apologize if this question
has been asked many times before. 

-jacques :)

Jacques Capesius
CNT Web Marketing Developer
[EMAIL PROTECTED]
(763) 268-6749

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


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

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

Reply via email to