Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to restart tomcat through a jsp page...

807589May 3 2007 — edited Aug 26 2008
I want to be able to restart tomcat through my web application that runs on tomcat 5.5 (the same server). Its annoying having to ssh to the machine and run a command line to restart the server. I have a linux shell script which shuts down the server and then restarts it. I am calling it from my bean. The idea is when i click a button on a jsp page, the bean registers the request and calls the shell script to restart the server. My code all works fine. However the restart script fails. It shuts down the server but does not start it up again. There are error messages. I think the problem is the existing threads running on the system when the restart script is called. However if i call the restart script independantly from the command line it works fine

03-May-2007 17:57:33 org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
03-May-2007 17:57:34 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
03-May-2007 17:57:34 org.apache.coyote.http11.Http11BaseProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
03-May-2007 17:57:34 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime
Exception in thread "Thread-3" java.lang.NullPointerException
at cmt.common.Log.reportPageGenInfo(Log.java:108)
at cmt.pagegen.FileChangeMonitor.run(FileChangeMonitor.java:45)
at java.lang.Thread.run(Unknown Source)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2008
Added on May 3 2007
9 comments
605 views