Search code examples
netbeansserverglassfish

Could not start GlassFish Server4.1 HTTP or HTTPS Listener port is occupied while server is not running ON A MAC


Could anyone shed some light on this? I have watched a few YouTube videos with the same problem but all solutions are based on Windows. How could I fix this on a Mac? I'm pretty sure I have no other servers running.

Thanks see error image from netbeans


Solution

  • This means that there is another application using the ports the Glassfish requires. Use the command

    lsof -nP -iTCP:$PORT | grep LISTEN

    to list the what ports are in use along with the process ID of the process using the port. Glassfish requires ports 4848, 8080 and 8081 to be free. One app that sometimes causes port issues is vnc, so check if you have screen sharing turned on and try disable it if that is the case.