Vyacheslav
Vyacheslav

Reputation: 3244

eclipse sts cannot start tomcat: ports already in use

Tested eclipse indigo, STS 2.5.2, STS 2.8.0, STS 2.8.5. Tomcat 6, Tomcat 7.

Tomcat startup hangs at 23%(displayed at right bottom side of eclipse windows/screen). This magic number is always the same. After about 20 seconds at hanged state error occurs. Error info is "ports are already in use".

There is no Tomcat already started in system. No ports with specified numbers appear in netstat.

Changing port numbers does not help anything.

Changing/reinstalling eclipse,STS,tomcat, downloading fresh tomcat zip changes nothing. Deleting workspace and C:/Project/.metadata and stuff - all directories used by fresh install of STS, so deleting them does not help too.

And interesting history aspect: i've used STS 2.8.2 for 2 weeks before this error occured. Reinstall won't fix anything. After that i was able to use STS 2.5.2 for a month. And the same error occured for 2.8.2. But i delete all its files and reinstall again does not fix anything.

Reboot does not help.

Have no any other working with tomcat version of eclipse/STS.

Any help is appreciated.

Also please add tag for http://www.springsource.com/developer/sts

my os is windows 7. In Virtualbox XP everything is fine. And other Windows 7 guys say it works too on their PCs.

Upvotes: 3

Views: 17657

Answers (9)

Gaurav pratap singh
Gaurav pratap singh

Reputation: 11

1> open task manager and end the process javaw.exe if it not work then 2>create a new file application.properties under resources and this -server.port = 8081

Upvotes: 0

Mohit Jaiswal
Mohit Jaiswal

Reputation: 1

Goto task manager---->details----->search for javaw.exe and select it(you can search bt typing 'j' in details)---->finally tap on end button. ----restart tomcat,it will work. or

kill the javaw.exe from Taskmanager

Upvotes: 0

Alex Semykin
Alex Semykin

Reputation: 37

I had the same problem on Linux.

  1. Close Eclipse.
  2. Open terminal and type 'top', then find a process called 'java' and the respective PID.
  3. Type 'kill [PID]' and restart Eclipse

Upvotes: 0

Saurabh J
Saurabh J

Reputation: 123

1)Kill javaw.exe process from TaskManager in Windows

2)restart eclipse

Upvotes: -1

Neeraj
Neeraj

Reputation: 1173

if you are on linux

netstat -nab | grep :8080

we have simlar command on windows i guess you use find instead of grep.

this will help you find the process id blocking port 8080

Also try telnet 8080 to get an idea

sometimes windows firewall also blocks ports - make sure firewall has an exception for this port.

Upvotes: 0

shameer salim
shameer salim

Reputation: 11

The above solutions didnt work for me. Open command prompt -> navigate to tomcat bin folder -> kill tomcat instance (shutdown.bat)

And then start the tomcat from eclipse. It worked just fine for me

Upvotes: 0

qarataw
qarataw

Reputation: 33

Kill "java.exe" process from TaskManager in Windows

Upvotes: 3

ILMaliek
ILMaliek

Reputation: 29

I have the same problem as yours.

To solve this problem, open Internal Web Browser inside eclipse / STS, then open

http//localhost:8080/yourproject/

then try to running tomcat again. Now tomcat should be running.

Looks like very funny eh, but it works on me. This might be bugs on eclipse / STS. I found this problem only on windows, and so far never happen on my linux.

Upvotes: 2

fargraph
fargraph

Reputation: 78

This isn't a great answer, but it got me up and running on my local machine. I had the same results, except for the port error you indicated. Mine would just say "Server failed to start in 45 seconds" with no other explanation. I could adjust the server start time, but that would only delay the inevitable. I had been using tomcat in /opt/dev. I downloaded Tomcat 7.0.26 and installed it into my home directory. I started STS and removed all of my tomcat 7 runtimes. Then I added a new server runtime:

  1. Window->Preferences->Servers->"Runtime Environments"
  2. Click "Add..."
  3. Chose "Apache Tomcat v7.0" and check "Create a new local server"
  4. Point the Installation directory to the server folder in your home directory.
  5. Click finish.

I then did a sample server start from within eclipse with no projects added and it started up fine. I don't know what happened, but this seems to have fixed the problem. I then added my projects and things started up just fine.

Upvotes: 0

Related Questions