简体   繁体   中英

running tomcat 5.5 server in Eclipse Helios

i have build jsp page that i want to run on tomcat server in eclipse

whenever,i try to do this,i get the following error:

Several ports (8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

the address:http://localhost:8080/ opens just fine in the browser .

i start the tomcat5 service manually using windows services

there is other service running on ports 8009,8080. the firewall is even not blocking

The error means the same what it says, "you can't run 2 instances of server on the same port". In this case, it can be another project of yours that might have used tomcat previously and hasn't left it yet.

Solution:

If you are not sure if your port are currently being used :

  • Either, visit the link http://localhost:8080/ on your browser. If you get to the server's homepage or see a typical 404 error, your connetion is being used.
  • Or, simply type the command netstat -a in a terminal (linux) or command prompt (windows). It'll list down all the ports open/listening on your machine.

Once you get to know that the port you want to use is already in use,

  • Either, shutdown the system, which will automatically free the ports - bad option.
  • Or, change the ports 8001,8080,8009 from server.xml file you'll find it inside the /conf directory of tomcat folder.
  • Or, traverse to the place where you have installed your Apache Tomcat go to the /bin folder and execute the shutdown.bat file (windows) or shutdown.sh file (Linux). It'll close your server and thus freeing the ports which were in use open eclipse again and restart the server

You cannot run two Tomcat servers on the same port. When you intend to develop and not to let your machine act as a real webserver for the world wide web, then just stop and disable the Window service. It is not useful for you. This way the port comes free for local Tomcat instance in Eclipse.

Or if you really want to keep the Windows service for some reason, then you'll give your development Tomcat machine a different port number. Doubleclick the server entry in Eclipse to get the configuration screen. You can edit the port numbers there.

In the future, installing Tomcat should be as simple as downloading the zip and extracting it. The exe installer contains a Windows specific service, but actually no service needs to be installed for just local development.

在Windows上停止tomcat服务,然后在eclipse中启动tomcat。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM