Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat doesn't refresh new source code without restarting it 1

Status
Not open for further replies.

thelordoftherings

Programmer
May 16, 2004
616
IL
Hello,

I am using Tomcat v5.0.28.
Every Servlet (or other code) that write and put at the webapps folder is being executed OK, but when I change the source code, the Tomcat always loads the older version. Only after restarting the Tomcat I can see the new version of the code. What could be the problem here?
 
>>> What could be the problem here?

Tomcat.

When you manually update .class files, Tomcat's class loader does not update.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
So I will always have to stop-start it after every update? Or can I change the Tomcat's class loader?
 
>>>>> Or can I change the Tomcat's class loader?
You can - but only an expert would be able to do this - I think its a bit out of your league.


>>>>> So I will always have to stop-start it after every update
Pretty much yes, if you are updating .class files manually. Isn't Tomcat great ?


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi sedj,

What do you mean by "if you are updating .class files manually". How else can I update them?

Feherke,
10X for the link.
 
Well, its possible to redploy .war files via the "tomcat manager" webapp ... but ...

1) I don't really trust it to *defintely* reload my classes
2) Hot deployment to Tomcat kills any custom JNDI factories you may be using (fact)
3) I don't use it, nor trust it - so would be hesitant to use it.

I've been developing apps deployed in Tomcat for 3 years, and the 20 or so developers in my company stop and start tomcat when they update .class files - its just the way we work, and have got used to doing it (an Ant script helps to unpack the war files, and restart tomcat)

But why not try the tomcat deployer ... it may work for you !



--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
10X a lot sedj for sharing this valuable information.
It's always a pleassure reading your posts... :)
 
By the way, do I need to restart it when I also make changes to static files such as html files or deployment descriptors?
 
>>> html files
No.

>>> deployment descriptors
Yes.

It will also recompile JSPs on the fly without restarting.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top