Solved

Restart Tomcat Manually

Posted on 2009-04-06
4
1,064 Views
Last Modified: 2013-12-27
I'm getting the following error when I try to run a servlet on Eclipse.  Starting Tomcat v6.0 Server at LocalHost has encountered a problem.  

Serveral Ports (8080, 8009) required by tomcat ... are already in use.  The server may already be running in another process...

Basically, I'm pretty sure it didn't shut down properly.  I'd love to try to shut it down manually through the terminal (on a mac) but not sure how.  

Any ideas?

B-rad
0
Comment
Question by:b_rad_wright
  • 3
4 Comments
 
LVL 14

Expert Comment

by:Deepak Kosaraju
ID: 24083022
You can say following command, enter root user passwd when prompted.
To Stop

sudo /Library/StartupItems/Tomcat/Tomcat stop
 

To Start

sudo /Library/StartupItems/Tomcat/Tomcat start

Open in new window

0
 
LVL 14

Expert Comment

by:Deepak Kosaraju
ID: 24083036
Another method of doing it is discuss here
Starting and Stopping Tomcat
Tomcat expects certain environment variables to be defined before it starts. In order to simplify the startup and shutdown processes, you can create re-usable scripts. I usually store scripts like these in a directory called bin under my home directory. (Thats pretty standard in the Unix world.)

liz@localhost:~> mkdir bin
liz@localhost:~> cd bin
liz@localhost:bin>
Now you can create a file (using your favorite text editor, must be saved with unix line endings) called ~/bin/start_tomcat with the following contents:

#!/bin/sh
export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0.1
export JAVA_HOME=/usr
$CATALINA_HOME/bin/startup.sh
And a file called ~/bin/stop_tomcat with these contents:

#!/bin/sh
export CATALINA_HOME=/usr/local/jakarta-tomcat-4.0.1
export JAVA_HOME=/usr
$CATALINA_HOME/bin/shutdown.sh
Finally, you must make these files executable:

liz@localhost:bin> chmod ug+x start_tomcat stop_tomcat

Reference Link:http://developer.apple.com/internet/java/tomcat1.html
0
 

Author Comment

by:b_rad_wright
ID: 24083082
So this obviously displays that I am a novice, but can you give me a little more beginning info on your first solution?  Specifically, what is sudo?  Is this done in the Terminal?  if so, what directory do I need to be in?

The second solution is way over my head.   Sorry for the inconvenience
0
 
LVL 14

Accepted Solution

by:
Deepak Kosaraju earned 125 total points
ID: 24083311
Yes sudo is done in terminal, sudo is used to access r run any command as root privileges as rollbased user. you can be in any directory to issue that sudo command because we are pointing the absolute path to sudo.
but before running the above sudo make sure you have the /Library/StartupItems/Tomcat/ following dir and binaries inside it.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now