skip to Main Content

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..

3

Answers


  1. 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

    Login or Signup to reply.
  2. 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)

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search