0

Issue with apache tomcat server always running a program its showing that port 8080 is already used..

netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >

I tried this every time that error is shown the problem is solved.

but has to done each time the server to be started or restarted.

I want a permanent solution to resolve this instead of each and every time manually stop the process in 8080..

Karthikeyan Vaithilingam
  • 6,473
  • 10
  • 41
  • 60
  • Port 8080 required by Tomcat v8.0 Server at localhost is 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). – Melwin Francis Aug 09 '19 at 04:22

3 Answers3

0

you could either change the port of the other process to avoid a port conflict, or simply change it in tomcat

How to change tomcat port number

and change it to something like 8081

munHunger
  • 1,617
  • 1
  • 20
  • 42
0

Looks like a service automatically starts on each startup, have you had a look between your services which automatically restarts?

You can have a look which executable is running on which port with following command (needs admin privileges):

netstat -a -b

Got the command from here: How can you find out which process is listening on a port on Windows?

and you should have an output like this:

  TCP    0.0.0.0:8080           WS1515:0               LISTENING
 [java.exe]

This should give already a hint which process automatically start on each startup, you can have a look in the service tab (you open a run window and input services.msc and press enter)

bramdc
  • 436
  • 4
  • 16
0

Since you are using netstat, I believe you are using Windows. There are two ways in which you can handle the issue:

  1. Disable tomcat service that is running by checking in services.msc. You can change the mode of startup from automatic to manual. This usually happens when you have installed a software using an msi that installs the tomcat service as a part of it.

  2. You can try to change your tomcat server port by editing the following lines in the /conf/server.xml:

    <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>

Change port = 8080 to something else like port = 8082. In that way, you can continue using the customized tomcat without harming any other essential service that has been installed as mentioned in point #1 above

Kavitha Karunakaran
  • 1,165
  • 13
  • 25