Difficulty Restarting Tomcat5

I'm using Linux (Ubuntu 6).  I've never used Tomcat before, so this is my first attempt at deploying a servlet.  I got it up and running fairly smoothly, and deployed an example "HelloWorld" servlet.  However, I noticed that when I modify the servlet class, and then recompile it, the changes I made do not actually take effect when I activate the servlet through a browser.  So, I figured I need to restart Tomcat.  (This is a bit annoying - do you really need to restart Tomcat everytime you make a modification to a servlet class?)

So, there is a daemon launcher script at /etc/init.d/tomcat5.  However, I run into this odd problem where if I stop or restart Tomcat, I can't start it again.  I type "tomcat5 start", and it says that Tomcat is started, but it doesn't actually start - (i.e. no PID is generated), and when I type "tomcat5 status" it tells me that tomcat is not running.  So I need to actually reboot my machine in order to successfully start tomcat again.

Unfortunately, I can't find this problem documented anywhere.  Does anyone have any idea why this might be happening?  Is there another way I'm supposed to be starting/stopping tomcat5?  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I would suggest reading the Tomcat documenation found at http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

While restarting tomcat is one way, you can also unload the servet and re-load it while tomcat is running. The understanding is, when you create a servlet, tomcat uncompiles an extracts the servet to run it, therefore when changes are made it needs to be reloaded.
You can also.. just.. "touch web.xml" in WEB-INF directory of web application.. which will cause web application to reload..

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
First, "tomcat5 start" isn't a valid command unless you have made a highly unusual change to your Linux configuration.  Unlike Windows, Linux doesn't put the current directory on the path.  So it's always "sudo /etc/init.d/tomcat5 start" (or "restart").

Second, it makes sense that Tomcat wouldn't _default_ to automatically reloading changed servlets.  I have two tomcat websites that I haven't even looked at in two years.  Why add the overhead of checking for changes to sites that don't change?  It's just something you need while developing, and they have an option for that (not that I remember what it is :-) ).  Anyway, install the "tomcat5-admin" package, to get a management interface that will allow you to quickly reload apps.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.