Cannot start Tomcat from intellij to use port 8080 because port 18080 is in use?

I'm trying to understand why I am seeing the error "Error running <run config name>: Address localhost:8080 is already in use" when I try to start Tomcat from intellij.

I have checked that the port is not in use:
I am able to start Tomcat to use port 8080 directly.

My platform is Windows XP.
netstat -a shows that 8080 is not in use.
However the port 18080 is in use.

Does Intellij try to scan the ports in use before trying to start Tomcat?
Maybe there is a bug that means that when a port number ending in 8080 (like 18080) is in use intellij considers that the port 8080 is in use.

If I change the Tomcat configuration to use a different port e.g. 8181, then intellij can start Tomcat without any problem.

So I can work around the problem - but I would be interested to understand what the cause is.

3 comments
Comment actions Permalink

looking further into this - the problem may not be intellij but may be an update to the antivirus software in use.
We recently went to AVG 8.
I'll check further and see if it is a setting in AVG that is causing the problem.

0
Comment actions Permalink

Okay - the culprit was a setting in AVG 8

To fix this remove "8080" from the list of ports to be scanned in the AVG Web Shield component.
AVG: Tools->"Advanced setting..."->"Web Shield"->"Web Protection"
Remove 8080 from "Ports to be scanned"

0
Comment actions Permalink

Another fix (and probably wiser imho) is to change the port that tomcat run on.  open up the <tomcat_home>/conf/server.xml and replace 8080 with 8000.  Save the file, edit your tomcat configuration in Intellij to open localhost:8000 instead of localhost:8080 and fire it up.

AVG blocking 8080 is agreeably over cautious, but imagine how upset you'd be if you had this problem and it was some spyware with an open 8080 port...

0

Please sign in to leave a comment.