Failed to start GlassFish 4.0 (Windows) - port 1527 - address already in use

I am new to Java EE 7.

I have Netbeans 7.4 with GlassFish 4.0 and Java EE 7. On a 64-bit Windows 8.1 Pro machine. I want to start the GlassFish 4.0 server, so I clicked on the Services tab in Netbeans, and then in the "Servers" option, I right-click GlassFish Server 4.0 and click on the "Start" button.

When I did this, I received the following message: "Failed to start GlassFish Server 4.0: the HTTP or HTTPS listener port is busy until the server is started." I also have an IIS server, but I stopped it. After stopping IIS, I tried to start GlassFish again, but it showed me the same message.

There is also a window in Netbeans called Output - Java DB Database Process , and it showed me the following:

Tue May 06 22:03:11 GMT-05:00 2014 : Security manager installed using the Basic server security policy. Tue May 06 22:03:11 GMT-05:00 2014 Thread[main,5,main] java.io.FileNotFoundException: D:\Users\Juan Jose\.netbeans-derby\derby.log (Access is denied) Tue May 06 22:03:12 GMT-05:00 2014 : Could not listen on port 1527 on host localhost: java.net.BindException: Address already in use: JVM_Bind Tue May 06 22:03:12 GMT-05:00 2014 : Could not listen on port 1527 on host localhost: java.net.BindException: Address already in use: JVM_Bind 

I ran netstat -a on Windows to find out what happens to port 1527, and this port is in LISTENING mode.

So, how can I find out which application or process will pay for port 1527?

Thanks for the help!

+8
java java-ee windows glassfish netbeans-7
source share
3 answers

To find process 1 that supports the loaded port, try the following command:

 netstat -ano | find "1527" 

This will show the line with the port and the process identifier. eg:.

 TCP 127.0.0.1:1527 0.0.0.0:0 LISTENING 2268 

Once you have the process ID (e.g. 2268 ), run the following command to release the port (this will kill the process):

 taskkill /F /PID 2268 

Now try to run Glassfish.


On Linux:

 lsof -Pnl +M -i6 | grep 1527 

It produces:

 java 31139 1001 32u IPv6 114916062 0t0 TCP 127.0.0.1:1527 (LISTEN) 

Killed:

 kill -9 31139 

1 If you want to know a related program, see How do I know which service uses a specific port? p>

+13
source share

If the above does not work for anyone, then follow these steps. Of course it will work.

  • Go to C: \ Program Files \ glassfish-4.1 \ glassfish \ domains \ domain1 \ config

  • Open "domain.xml" in an xml editor or you can use notepad ++

  • Find "8080" (below for ur link)

    network-listener port = " 8080 " protocol = "http-listener-1" transport = "tcp" name = "http-listener-1" thread-pool = "http-thread-pool" enter image description here

  • Replace “8080” with any open port. If you do not know how to open an open port, try using port "3702" and then save the file

  • Now run the project

After starting the project, pay attention to the URL

http: // localhost: 8080 / ...... should be http: // localhost: 3702 / .....

To open open ports, follow these steps.

  • open cmd.exe

  • run cmd "netstat -ano"

Choose any that you find for free (as inside the green window above) enter image description here

+4
source share

This is not a mistake you need to worry about. When you start GlassFish, NetBeans will also launch the JavaDB database (aka, Derby), which by default listens on port 1527. When you disable NetBeans, it will disable GlassFish, but it will not disable JavaDB. Therefore, when starting NetBeans a second time, NetBeans will again try to start JavaDB and crash because it is already running and listening on port 1527.

To close the database, you can use NetBeans Services (Tab) → Databases → JavaDB (right-click-> Stop Server. To exit the command line, use NETBEANS_HOME / glassfish-4.0 / javadb / bin / stopNetworkServer, where $ NETBEANS_HOME is this is the top-level directory where NetBeans is installed (at least on Mac / Linux / Unix).

+3
source share

All Articles