Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The server cannot started because one or more of the ports are invalid [Tomcat in Eclipse]

When I open my file list-student.jsp. I experienced the following error:

Starting Tomcat v9.0 Server at localhost has encountered a problem. The server cannot be started because one or more of the ports are invalid. Open the server editor and correct invalid ports.

I tried to go server tab and change the port from 8080 to different number, but it doesn't work. I had the same problem before and I changed 8080 to another number liked 8181 and it worked, but today, even I tried to change port number and the problem can't be fixed.

Changing port number

like image 615
BouncySmoke Avatar asked Dec 31 '19 23:12

BouncySmoke


4 Answers

The issue is that the Tomcat admin port was not defined. You need to have it as an actual number such as 9000 rather than as a hyphen -.

Tomcat 9 configuration page (Eclipse)

like image 90
Joseph Waweru Avatar answered Oct 17 '22 16:10

Joseph Waweru


This issue came in Tomcat 9 version starting from Eclipse.

The server cannot started because one or more of the ports are invalid

Only Modify the server ports "Tomcat Admin Port" default value from hyphen (-) to zero(0) it's working fine.

enter image description here

like image 29
Saket Yadav Avatar answered Oct 17 '22 14:10

Saket Yadav


This is because the tomcat admin port or any other port was not defined.

enter image description here

Click ok and open the tomcat server at localhost.

enter image description here

In the highlighted area, if the port number is not defined then give it a port number, save the file and run again.

like image 14
Arya Avatar answered Oct 17 '22 16:10

Arya


This is how i fixed this : Go to Eclipse => Window => Show View => Servers => DoubleClick on Tomcat Server => Change admin port to "1" and leave the HTTP port to "8080" . Make sure to kill any processes which are running on port 8080.You will find your project on localhost:8080/java project name , if you don't add java project name it will give you error 404. Hope this works !

like image 10
Arbis Malasi Avatar answered Oct 17 '22 14:10

Arbis Malasi