start-domain failed Glassfish on Windows 7

16,801

Solution 1

It seems that Glassfish cannot start because an address it is trying to bind is already in use.

Shutting down server due to startup exception java.net.BindException: Address already in use: bind

Try to edit the domain.xml.

/glassfish/domains/domain1/config/domain.xml

The most common problem would be that the http-listener ports are reused by another application. Find the lines:

name="http-listener-1" port="8080" name="http-listener-1" port="9090"

And replace them with something like:

name="http-listener-2" port="8181" name="http-listener-2" port="9191"

You can also read more about the domain.xml

https://docs.oracle.com/cd/E19226-01/820-7694/abhar/index.html

Solution 2

I had same problem, same messages (might be different cause), I solved it by moving (unzip) Glassfish folder to a different location. The problem was that when I unziped GlassFish.zip on C:\ the folder's owner was "Administrator". By unzipping it in a different location (like c:\servers\GlassFish), the owner was my regular user. Plus I changed port="8080" and "8181" (to a 8060, 8061 in my case). My glassFish domain started successfully afterwards, I don't know which of those changes fixed it, and I don't care anymore.

Share:
16,801
Threx
Author by

Threx

Updated on June 04, 2022

Comments

  • Threx
    Threx about 2 years

    I wanted to start a Glassfish 4.1.1-Server on Windows 7 with JAVA 8 JDK 66, but my command asadmin start-domain failed. This seems to be an obscure error because I get a pretty long failure message in the command prompt (see below).

    Can anybody give me a hint what the problem is? Even a direction ("likly a problem with the firewall", "incompatible JDK-Version", etc.) would be a help...

    Thank you Threx

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    C:\Glassfish\bin>asadmin start-domain
    Waiting for domain1 to start ..........Error starting domain domain1.
    The server exited prematurely with exit code 0.
    Before it died, it produced the following output:
    
    Launching GlassFish on Felix platform
    Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRunt
    ime@810a64 in service registry.
    
        #!## LogManagerService.postConstruct : rootFolder=C:\Glassfish\glassfish
        #!## LogManagerService.postConstruct : templateDir=C:\Glassfish\glassfish\lib\te
        mplates
        #!## LogManagerService.postConstruct : src=C:\Glassfish\glassfish\lib\templates\
        logging.properties
        #!## LogManagerService.postConstruct : dest=C:\Glassfish\glassfish\domains\domain1\config\logging.properties
    Completed shutdown of Log manager service
    Completed shutdown of GlassFish runtime
    Nov 10, 2015 1:58:57 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvis
    ioner createBundleProvisioner
    INFORMATION: Create bundle provisioner class = class com.sun.enterprise.glassfis
    h.bootstrap.osgi.BundleProvisioner.
    Nov 10, 2015 1:58:57 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvis
    ioner$DefaultCustomizer getLocations
    WARNUNG: Skipping entry  because it is not an absolute URI.
    Nov 10, 2015 1:58:57 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvis
    ioner$DefaultCustomizer getLocations
    WARNUNG: Skipping entry  because it is not an absolute URI.
    Nov 10, 2015 1:59:01 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvis
    ioner startBundles
    WARNUNG: Can not start bundle file:/C:/Glassfish/glassfish/modules/core.jar beca
    use it is not contained in the list of installed bundles.
    [#|2015-11-10T13:59:04.227+0100|INFO|glassfish 4.1|javax.enterprise.logging|_Thr
    eadID=16;_ThreadName=RunLevelControllerThread-1447160343915;_TimeMillis=14471603
    44227;_LevelValue=800;_MessageID=NCLS-LOGGING-00009;|
      Running GlassFish Version: GlassFish Server Open Source Edition 4.1.1  (build
     1)|#]
    
    [#|2015-11-10T13:59:04.227+0100|INFO|glassfish 4.1|javax.enterprise.logging|_Thr
    eadID=16;_ThreadName=RunLevelControllerThread-1447160343915;_TimeMillis=14471603
    44227;_LevelValue=800;_MessageID=NCLS-LOGGING-00010;|
      Server log file is using Formatter class: com.sun.enterprise.server.logging.OD
    LLogFormatter|#]
    
    [#|2015-11-10T13:59:04.461+0100|INFO|glassfish 4.1|javax.enterprise.system.core.
    security|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160344461;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;|
      Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.
    FileRealm] successfully created.|#]
    
    [#|2015-11-10T13:59:04.477+0100|INFO|glassfish 4.1|javax.enterprise.system.core.
    security|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160344477;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;|
      Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRea
    lm] successfully created.|#]
    
    [#|2015-11-10T13:59:04.477+0100|INFO|glassfish 4.1|javax.enterprise.system.core.
    security|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160344477;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;|
      Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certi
    ficate.CertificateRealm] successfully created.|#]
    
    [#|2015-11-10T13:59:04.789+0100|INFO|glassfish 4.1|javax.enterprise.security.ser
    vices|_ThreadID=17;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMilli
    s=1447160344789;_LevelValue=800;_MessageID=SEC-SVCS-00100;|
      Authorization Service has successfully initialized.|#]
    
    [#|2015-11-10T13:59:04.820+0100|INFO|glassfish 4.1|org.hibernate.validator.inter
    nal.util.Version|_ThreadID=15;_ThreadName=RunLevelControllerThread-1447160343915
    ;_TimeMillis=1447160344820;_LevelValue=800;|
      HV000001: Hibernate Validator 5.1.2.Final|#]
    
    [#|2015-11-10T13:59:05.304+0100|INFO|glassfish 4.1|org.glassfish.ha.store.spi.Ba
    ckingStoreFactoryRegistry|_ThreadID=16;_ThreadName=RunLevelControllerThread-1447
    160343915;_TimeMillis=1447160345304;_LevelValue=800;|
      Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for per
    sistence-type = replicated in BackingStoreFactoryRegistry|#]
    
    [#|2015-11-10T13:59:05.335+0100|WARNING|glassfish 4.1|org.glassfish.grizzly.conf
    ig.Utils|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160345335;_LevelValue=900;|
      Instance could not be initialized. Class=interface org.glassfish.grizzly.http.
    server.AddOn, name=http-listener-1, realClassName=org.glassfish.grizzly.http2.Ht
    tp2AddOn|#]
    
    [#|2015-11-10T13:59:05.428+0100|WARNING|glassfish 4.1|org.glassfish.grizzly.conf
    ig.Utils|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160345428;_LevelValue=900;|
      Instance could not be initialized. Class=interface org.glassfish.grizzly.http.
    server.AddOn, name=http-listener-2, realClassName=org.glassfish.grizzly.http2.Ht
    tp2AddOn|#]
    
    [#|2015-11-10T13:59:05.600+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMillis=1447
    160345600;_LevelValue=800;_MessageID=NCLS-CORE-00087;|
      Grizzly Framework 2.3.23 started in: 172ms - bound to [/0.0.0.0:8181]|#]
    
    [#|2015-11-10T13:59:05.600+0100|WARNING|glassfish 4.1|org.glassfish.grizzly.conf
    ig.Utils|_ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMi
    llis=1447160345600;_LevelValue=900;|
      Instance could not be initialized. Class=interface org.glassfish.grizzly.http.
    server.AddOn, name=admin-listener, realClassName=org.glassfish.grizzly.http2.Htt
    p2AddOn|#]
    
    [#|2015-11-10T13:59:05.616+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=18;_ThreadName=RunLevelControllerThread-1447160343946;_TimeMillis=1447
    160345616;_LevelValue=800;_MessageID=NCLS-CORE-00087;|
      Grizzly Framework 2.3.23 started in: 16ms - bound to [/0.0.0.0:4848]|#]
    
    [#|2015-11-10T13:59:05.662+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=16;_ThreadName=RunLevelControllerThread-1447160343915;_TimeMillis=1447
    160345662;_LevelValue=800;_MessageID=NCLS-CORE-00087;|
      Grizzly Framework 2.3.23 started in: 0ms - bound to [/0.0.0.0:3700]|#]
    
    [#|2015-11-10T13:59:05.662+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=1;_ThreadName=main;_TimeMillis=1447160345662;_LevelValue=800;_MessageI
    D=NCLS-CORE-00017;|
      GlassFish Server Open Source Edition  4.1.1  (1) startup time : Felix (6.974ms
    ), startup services(1.762ms), total(8.736ms)|#]
    
    [#|2015-11-10T13:59:05.662+0100|SEVERE|glassfish 4.1|javax.enterprise.system.cor
    e|_ThreadID=1;_ThreadName=main;_TimeMillis=1447160345662;_LevelValue=1000;_Messa
    geID=NCLS-CORE-00019;|
      Shutting down server due to startup exception
    java.net.BindException: Address already in use: bind
            at sun.nio.ch.Net.bind0(Native Method)
            at sun.nio.ch.Net.bind(Unknown Source)
            at sun.nio.ch.Net.bind(Unknown Source)
            at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
            at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
            at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChanne
    lAndAddress(TCPNIOBindingHandler.java:131)
            at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOB
    indingHandler.java:88)
            at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransp
    ort.java:248)
            at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransp
    ort.java:237)
            at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransp
    ort.java:86)
            at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGriz
    zlyListener.java:184)
            at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(Gl
    assfishNetworkListener.java:109)
            at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start0(GrizzlyProxy.
    java:267)
            at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.j
    ava:241)
            at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy
    (GrizzlyService.java:567)
            at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(Griz
    zlyService.java:490)
            at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java
    :326)
            at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:374)
            at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:
    471)
            at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate
    (AsyncRunLevelContext.java:228)
            at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelConte
    xt.java:85)
            at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2072)
            at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl
    .java:114)
            at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl
    .java:88)
            at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.one
    Job(CurrentTaskFuture.java:1213)
            at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run
    (CurrentTaskFuture.java:1144)
            at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneLevel.run(
    CurrentTaskFuture.java:762)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)
    |#]
    
    [#|2015-11-10T13:59:05.740+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=55;_ThreadName=Thread-11;_TimeMillis=1447160345740;_LevelValue=800;_Me
    ssageID=NCLS-CORE-00092;|
      Server shutdown initiated|#]
    
    [#|2015-11-10T13:59:05.740+0100|INFO|glassfish 4.1|javax.enterprise.bootstrap|_T
    hreadID=1;_ThreadName=main;_TimeMillis=1447160345740;_LevelValue=800;_MessageID=
    NCLS-BOOTSTRAP-00027;|
      Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishIm
    pl@1aa7d76 as OSGi service registration: org.apache.felix.framework.ServiceRegis
    trationImpl@1a6a933.|#]
    
    [#|2015-11-10T13:59:06.754+0100|INFO|glassfish 4.1|javax.enterprise.bootstrap|_T
    hreadID=55;_ThreadName=Thread-11;_TimeMillis=1447160346754;_LevelValue=800;_Mess
    ageID=NCLS-BOOTSTRAP-00028;|
      Unregistered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFish
    Impl@1aa7d76 from service registry.|#]
    
    [#|2015-11-10T13:59:06.754+0100|INFO|glassfish 4.1||_ThreadID=55;_ThreadName=Thr
    ead-8;_TimeMillis=1447160346754;_LevelValue=800;|
      FileMonitoring shutdown|#]
    
    [#|2015-11-10T13:59:06.942+0100|INFO|glassfish 4.1|javax.enterprise.system.core|
    _ThreadID=55;_ThreadName=Thread-11;_TimeMillis=1447160346942;_LevelValue=800;_Me
    ssageID=NCLS-CORE-00013;|
      Shutdown procedure finished|#]
    
    Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=192m; support wa
    s removed in 8.0
    
    Command start-domain failed.
    
    C:\Glassfish\bin>