On Windows 7 I downloaded the 'netbeans-8.0.1-javaee-windows.exe' installer from this site https://netbeans.org/downloads/. The installer installs GlassFish 4.1, Java 1.8.0_20 and NetBeans 8.01. After installation, whenever I try to start the GlassFish server from within the NetBeans Services area, I get this error:
Could not start GlassFish Server 4.1: HTTP or HTTPS listener port is occupied while server is not running
So I used
netstat -ano | find "1527"
to find out which process is holding this port and as it seems it is the Java Derby database itself that was just started by the GlassFish process. So the Glassfish startup is complaining about something it just caused itself. Strange. I don't know what to do. Anybody any idea?
Thanks already.
I also had this problem, it is because there is an application LISTENING to 8080 port. To solve this problem I followed the below steps:
Open cmd.exe then type
netstat -aon | find ":8080" | find "LISTENING"
You will see like this result
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 1464
Copy PID "1464".
Open Task Manager (Ctrl+Alt+del), go to the details tag, then find the program or service via PID that is listening to the port 8080 then STOP it or End process.
Your description is a little bit strange because the GlassFish server can even start if port 1527 is occupied, because the Java Derby database is a separate java process. So one option could be to just ignore the message in case that the real GlassFish server is indeed starting correctly (NetBeans displays the output for the GlassFish server and the Derby server in different tabs).
Nevertheless you can try to disable starting the registered Derby server for your GlassFish instance.
Make sure that the Derby server is shut down, it can even still run if you have closed NetBeans. If you are not sure kill every java process via the task manager and restart NetBeans.
Right-click your GlassFish instance in the Services tab and choose Properties.
If instead the real problem is that either port 8080 or 443 (if you activated the HTTPS listener) is in use (which would really prevent GlassFish from starting), you have to find out which application is using this port (maybe Tomcat or something similar) and shut it down.
The error message
'Could not start GlassFish Server 4.1: HTTP or HTTPS listener port is occupied while server is not running'
just points a little bit more in this direction...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With