[java] Cannot start GlassFish 4.1 from within Netbeans 8.0.1 Service area

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.

This question is related to java netbeans glassfish

The answer is


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:

  1. Open cmd.exe then type

    netstat -aon | find ":8080" | find "LISTENING"

  2. You will see like this result

    TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 1464

  3. Copy PID "1464".

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


I have the same problem. Mine is caused by a vmware installation. It is vmware worstation v8 on windows 7 and was a default installation.

Running netstat -aon | find ":80" | find "LISTENING" from cmd showed PID of the service causing the problem, this related to vmware. Going to services, I manually stopped all of the running vmware services (did not change their start up type, just a manual stop - I want them to work again after the next reboot) I could immediately test my webservice, glassfish 4 started as it should.

Hope it helps


Following are the steps that will definitely work:

  1. Open CMD : Press Windows+R from keyboard or just type "cmd" in windows search
  2. Type Following in cmd : netstat -aon | find ":8080" | find "LISTENING"
  3. See the last column : There will be some number like 2816 or similar.(It will differ from this)
  4. Now open Task Manager (Keyboard shortcut : Ctrl+Shift+Esc)
  5. In that, go to Details Tab and under PID Column, search for the number you found in step 3
  6. Right Click on it and select end process
  7. Now happily go to Netbeans and Run your program

NOTE : If you are running your program for the first time in Netbeans, it takes some time. So don't worry if it takes time.


You will get like this error

error ss

Try the following steps

1. Open Command Prompt (Press Windows key and type "cmd" and hit Enter) Then type this command as show in picture

netstat -aon | find ":8080" | find "LISTENING" cmd command

  1. Now open Task Manager (Press Windows key and type "Task Manager" and hit Enter) In that, go to Details Tab and under PID Column, search for the number you found in cmd

task manager

  1. Right Click on that program and select end process

Yes you can solve this error by changing the port number of glassfish because the WAMP SERVER or ORACLE database software uses a port number 8080, so there is a conflict of port number.

1)open a path like C:\GlassFish_Server\glassfish\domains\domain1\config\domain.xml.

2)find out the 8080 port number with the help of ctrl+F. You will get the following code...

<network-listener protocol="http-listener-1" port="8080" name="http-listener-1" thread-pool="http-thread-pool" transport="tcp">

3) Change that port number from 8080 to 9090 or 1234 or whatever you like..

4) Save it. Open a Netbeans IDE goto the glassfish server .

5) Right click on the server -> select refresh option.

6) to check the port no. which is given by u just right click on the server-> property.

7) Start the Glassfish server . Yehhh the error is gone...


I get the same error when I run Oracle XE instance on the same machine. As my database is Oracle, I preferred changing Glassfish's default port:

  1. Locate domain.xml inside Glassfish installation folders.
  2. Change the the port on the below line:

_x000D_
_x000D_
  <network-listener port="9090" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>_x000D_
        
_x000D_
_x000D_
_x000D_


I found an easier way to go about this nagging problem. Register GlassFish Server without setting user/password the first time. Then right click GlassFish then to View Domain Admin Console. On the Glassfish admin page that appears, you will see Change Administrator Password under Administration on the GlassFish Console- Common Tasks. Click to set your password by changing the default password. The user is admin but the password is up to you to change it. Save your change. Go back to Netbeans and you will immediately see a popout screen asking you to enter your admin credentials. Enter admin for user and the password. That is it. If your Netbeans come with Glassfish, just right click the server then to View Domain Admin Console then follow the rest of the steps explained above


If you are using netbeans 7 and greater with oracle xe do the following on netbeans :

  1. go to services tab
  2. under servers, remove glassfish
  3. add back glassfish server
  4. input port number 9090 for http access

Glassfish can use that one if available or some random port number is created


you can easily resolve this problem by changing the port number of glassfish.

Go to glassfich configuration File domain.xml which is located under GlassFish_Server\glassfish\domains\domain1\config.

Open this file, then change the following line:

<network-listener port="8080" protocol="http-listener-1" transport="tcp" 
name="http-listener-1" thread-pool="http-thread-pool"></network-listener>  

replace 8080 by 9090 for example, then save file and run glassfish again. it should nicely work.


Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to netbeans

Can't create project on Netbeans 8.2 I'm getting favicon.ico error Cannot find java. Please use the --jdkhome switch Netbeans 8.0.2 The module has not been deployed Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command Cannot start GlassFish 4.1 from within Netbeans 8.0.1 Service area javac: invalid target release: 1.8 connecting MySQL server to NetBeans Starting of Tomcat failed from Netbeans Display Records From MySQL Database using JTable in Java

Examples related to glassfish

Cannot start GlassFish 4.1 from within Netbeans 8.0.1 Service area How to configure Glassfish Server in Eclipse manually org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException Location of GlassFish Server Logs How do I specify the JDK for a GlassFish domain? How to return a PNG image from Jersey REST service method to the browser Could not open ServletContext resource What is the difference between Tomcat, JBoss and Glassfish? Address already in use: JVM_Bind What does 'URI has an authority component' mean?