java.net.BindException: Address already in use: bind

Java.net JIRA | theonion | 2 years ago
  1. 0

    My Os is Win7 i'm using glassfish 4.0 b89. When is start the server with "asadmin start-domain" asadmin start-domain .. continues very long time and ends with "serverNoStart Command start-domain failed." The exception i see in the log file is: [2014-09-03T15:31:30.000+0300] [glassfish 4.0] [SEVERE] [NCLS-CORE-00019] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1409747490000] [levelValue: 1000] [[ 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(Net.java:414) at sun.nio.ch.Net.bind(Net.java:406) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:87) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95) at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168) at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94) at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230) at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470) at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393) at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204) at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneJob.run(CurrentTaskFuture.java:490) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.go(CurrentTaskFuture.java:362) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.access$100(CurrentTaskFuture.java:279) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296) at org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66) at com.sun.enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532) at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:329) at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226) at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217) at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79) at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63) at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75) at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63) at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71) at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97) at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54) ]] all through the server is accessible on localhost:4848 and looks started

    Java.net JIRA | 2 years ago | theonion
    java.net.BindException: Address already in use: bind
  2. 0

    My Os is Win7 i'm using glassfish 4.0 b89. When is start the server with "asadmin start-domain" asadmin start-domain .. continues very long time and ends with "serverNoStart Command start-domain failed." The exception i see in the log file is: [2014-09-03T15:31:30.000+0300] [glassfish 4.0] [SEVERE] [NCLS-CORE-00019] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1409747490000] [levelValue: 1000] [[ 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(Net.java:414) at sun.nio.ch.Net.bind(Net.java:406) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:87) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95) at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168) at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94) at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230) at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470) at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393) at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204) at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneJob.run(CurrentTaskFuture.java:490) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.go(CurrentTaskFuture.java:362) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.access$100(CurrentTaskFuture.java:279) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296) at org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66) at com.sun.enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532) at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:329) at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226) at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217) at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79) at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63) at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75) at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63) at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71) at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97) at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54) ]] all through the server is accessible on localhost:4848 and looks started

    Java.net JIRA | 2 years ago | theonion
    java.net.BindException: Address already in use: bind
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Web devtests perform many stop/start for functionality testings that require server restart and failing to do so is affecting test results. This intermittent issue is causing multiple failures in web devtests. The server fails to shut down with an error "java.lang.IllegalStateException: Service already unregistered." and subsequent restart fails since the shutdown did not happen. According to Sahoo, "it will surely impact embeddability of glassfish which is leveraged in cloudlogic and other places". [2013-04-25T20:22:24.190-0700] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=63 _ThreadName=Thread-16] [timeMillis: 1366946544190] [levelValue: 800] [[ Server shutdown initiated]] [2013-04-25T20:22:24.191-0700] [glassfish 4.0] [WARNING] [NCLS-BOOTSTRAP-00029] [javax.enterprise.bootstrap] [tid: _ThreadID=63 _ThreadName=Thread-16] [timeMillis: 1366946544191] [levelValue: 900] [[ Exception while unregistering: java.lang.IllegalStateException: Service already unregistered. at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:123) at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.unregisterService(EmbeddedOSGiGlassFishImpl.java:93) at com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.stop(EmbeddedOSGiGlassFishImpl.java:81) at com.sun.enterprise.v3.admin.StopServer.doExecute(StopServer.java:79) at com.sun.enterprise.v3.admin.StopDomainCommand.execute(StopDomainCommand.java:96) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:356) at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522) at org.glassfish.api.AsyncImpl$1$1.run(AsyncImpl.java:76) ]] ..... [2013-04-25T20:22:47.601-0700] [glassfish 4.0] [INFO] [NCLS-CORE-00017] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1366946567601] [levelValue: 800] [[ GlassFish Server Open Source Edition 4.0 (re-continuous) startup time : Felix (3,641ms), startup services(3,534ms), total(7,175ms)]] [2013-04-25T20:22:47.601-0700] [glassfish 4.0] [SEVERE] [NCLS-CORE-00019] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1366946567601] [levelValue: 1000] [[ Shutting down server due to startup exception java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:344) at sun.nio.ch.Net.bind(Net.java:336) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:199) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:87) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95) at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168) at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94) at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230) at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470) at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393) at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281) at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328) at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448) at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:158) at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2203) at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673) at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) ]] [2013-04-25T20:22:47.640-0700] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=51 _ThreadName=Thread-13] [timeMillis: 1366946567640] [levelValue: 800] [[ Server shutdown initiated]]

    Java.net JIRA | 4 years ago | Amy Roh
    java.net.BindException: Address already in use
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.net.BindException

    Address already in use: bind

    at sun.nio.ch.Net.bind0()
  2. Java RT
    ServerSocketAdaptor.bind
    1. sun.nio.ch.Net.bind0(Native Method)
    2. sun.nio.ch.Net.bind(Net.java:414)
    3. sun.nio.ch.Net.bind(Net.java:406)
    4. sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
    5. sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    5 frames
  3. Grizzly
    TCPNIOTransport.bind
    1. org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131)
    2. org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:87)
    3. org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:450)
    4. org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:439)
    5. org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:95)
    5 frames
  4. Nucleus Grizzly jars Combining
    GenericGrizzlyListener.start
    1. org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:168)
    1 frame
  5. Kernel Classes
    GrizzlyService.postConstruct
    1. com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:94)
    2. com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:230)
    3. com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:470)
    4. com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:393)
    4 frames
  6. ServiceLocator Default Implementation
    SystemDescriptor.create
    1. org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:281)
    2. org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:328)
    3. org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
    3 frames
  7. Run Level Service
    AsyncRunLevelContext.findOrCreate
    1. org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:163)
    1 frame
  8. ServiceLocator Default Implementation
    ServiceHandleImpl.getService
    1. org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
    2. org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
    2 frames
  9. Run Level Service
    RunLevelControllerImpl.proceedTo
    1. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:673)
    2. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:660)
    3. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneJob.run(CurrentTaskFuture.java:490)
    4. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.go(CurrentTaskFuture.java:362)
    5. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpAllTheWay.access$100(CurrentTaskFuture.java:279)
    6. org.glassfish.hk2.runlevel.internal.CurrentTaskFuture.go(CurrentTaskFuture.java:113)
    7. org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.proceedTo(AsyncRunLevelContext.java:296)
    8. org.glassfish.hk2.runlevel.internal.RunLevelControllerImpl.proceedTo(RunLevelControllerImpl.java:66)
    8 frames
  10. Kernel Classes
    AppServerStartup.start
    1. com.sun.enterprise.v3.server.AppServerStartup.proceedTo(AppServerStartup.java:532)
    2. com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:329)
    3. com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:226)
    4. com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:217)
    4 frames
  11. Appserver Core
    GlassFishMain$Launcher.launch
    1. com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
    2. com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    3. com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl.start(EmbeddedOSGiGlassFishImpl.java:75)
    4. com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
    5. com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:71)
    6. com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
    6 frames
  12. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:483)
    4 frames
  13. Appserver Core
    ASMain.main
    1. com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
    2. com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
    2 frames