0

I am getting the below error. Any help will be appreciated.

$ sudo glassfish4/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.EmbeddedOSGiGlassFishRuntime@72d53ac7 in service registry. Found populator: com.sun.enterprise.v3.server.GFDomainXml



#!## LogManagerService.postConstruct : rootFolder=/srv/glassfish4/glassfish
#!## LogManagerService.postConstruct : templateDir=/srv/glassfish4/glassfish/lib/templates
#!## LogManagerService.postConstruct : src=/srv/glassfish4/glassfish/lib/templates/logging.properties
#!## LogManagerService.postConstruct : dest=/srv/glassfish4/glassfish/domains/domain1/config/logging.properties Completed shutdown of Log manager service Completed shutdown of GlassFish runtime Watcher for /srv/glassfish4/glassfish/domains/domain1/autodeploy/bundles exiting because of interruption.: java.lang.InterruptedException java.lang.InterruptedException  at java.lang.Object.wait(Native Method)     at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:226) Oct 27, 2014 8:57:08 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner. Oct 27, 2014 8:57:08 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations WARNING: Skipping entry  because it is not an absolute URI. Oct 27, 2014 8:57:08 PM com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations WARNING: Skipping entry  because it is not an absolute URI. [#|2014-10-27T20:57:15.978-0700|INFO|glassfish
4.1|javax.enterprise.logging|_ThreadID=15;_ThreadName=RunLevelControllerThread-1414468635292;_TimeMillis=1414468635978;_LevelValue=800;_MessageID=NCLS-LOGGING-00009;| Running GlassFish Version: GlassFish Server Open Source Edition  4.1  (build 13)|#]

[#|2014-10-27T20:57:15.989-0700|INFO|glassfish
4.1|javax.enterprise.logging|_ThreadID=15;_ThreadName=RunLevelControllerThread-1414468635292;_TimeMillis=1414468635989;_LevelValue=800;_MessageID=NCLS-LOGGING-00010;| Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter|#]

[#|2014-10-27T20:57:17.173-0700|INFO|glassfish
4.1|org.hibernate.validator.internal.util.Version|_ThreadID=15;_ThreadName=RunLevelControllerThread-1414468635292;_TimeMillis=1414468637173;_LevelValue=800;| HV000001: Hibernate Validator 5.0.0.Final|#]

[#|2014-10-27T20:57:17.266-0700|INFO|glassfish
4.1|javax.enterprise.system.core.security|_ThreadID=14;_ThreadName=RunLevelControllerThread-1414468635273;_TimeMillis=1414468637266;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;| Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]

[#|2014-10-27T20:57:17.320-0700|INFO|glassfish
4.1|javax.enterprise.system.core.security|_ThreadID=14;_ThreadName=RunLevelControllerThread-1414468635273;_TimeMillis=1414468637320;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;| Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]

[#|2014-10-27T20:57:17.473-0700|INFO|glassfish
4.1|javax.enterprise.system.core.security|_ThreadID=14;_ThreadName=RunLevelControllerThread-1414468635273;_TimeMillis=1414468637473;_LevelValue=800;_MessageID=NCLS-SECURITY-01115;| Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.|#]

[#|2014-10-27T20:57:17.954-0700|INFO|glassfish
4.1|org.glassfish.ha.store.spi.BackingStoreFactoryRegistry|_ThreadID=17;_ThreadName=RunLevelControllerThread-1414468635378;_TimeMillis=1414468637954;_LevelValue=800;| Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry|#]

[#|2014-10-27T20:57:18.164-0700|INFO|glassfish
4.1|javax.enterprise.security.services|_ThreadID=14;_ThreadName=RunLevelControllerThread-1414468635273;_TimeMillis=1414468638164;_LevelValue=800;_MessageID=SEC-SVCS-00100;| Authorization Service has successfully initialized.|#]

[#|2014-10-27T20:57:18.406-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=16;_ThreadName=RunLevelControllerThread-1414468635370;_TimeMillis=1414468638406;_LevelValue=800;_MessageID=NCLS-CORE-00087;|   Grizzly Framework 2.3.15 started in: 113ms - bound to [/0.0.0.0:8181]|#]

[#|2014-10-27T20:57:18.982-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=16;_ThreadName=RunLevelControllerThread-1414468635370;_TimeMillis=1414468638982;_LevelValue=800;_MessageID=NCLS-CORE-00087;|   Grizzly Framework 2.3.15 started in: 129ms - bound to [/0.0.0.0:4848]|#]

[#|2014-10-27T20:57:19.308-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=17;_ThreadName=RunLevelControllerThread-1414468635378;_TimeMillis=1414468639308;_LevelValue=800;_MessageID=NCLS-CORE-00087;|   Grizzly Framework 2.3.15 started in: 11ms - bound to [/0.0.0.0:3700]|#]

[#|2014-10-27T20:57:20.181-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=1;_ThreadName=main;_TimeMillis=1414468640181;_LevelValue=800;_MessageID=NCLS-CORE-00017;|   GlassFish Server Open Source Edition  4.1  (13) startup time : Felix (9,542ms), startup services(4,931ms), total(14,473ms)|#]

[#|2014-10-27T20:57:20.183-0700|SEVERE|glassfish
4.1|javax.enterprise.system.core|_ThreadID=1;_ThreadName=main;_TimeMillis=1414468640183;_LevelValue=1000;_MessageID=NCLS-CORE-00019;| 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:444)    at sun.nio.ch.Net.bind(Net.java:436)    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:132)  at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bind(TCPNIOBindingHandler.java:88)  at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:236)   at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:225)   at org.glassfish.grizzly.nio.transport.TCPNIOTransport.bind(TCPNIOTransport.java:85)    at org.glassfish.grizzly.config.GenericGrizzlyListener.start(GenericGrizzlyListener.java:180)   at com.sun.enterprise.v3.services.impl.GlassfishNetworkListener.start(GlassfishNetworkListener.java:109)    at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start0(GrizzlyProxy.java:267)   at com.sun.enterprise.v3.services.impl.GrizzlyProxy.start(GrizzlyProxy.java:241)    at com.sun.enterprise.v3.services.impl.GrizzlyService.createNetworkProxy(GrizzlyService.java:567)   at com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:490)    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)   at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)    at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227)     at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84)     at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)  at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)  at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)   at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)    at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  at java.lang.Thread.run(Thread.java:745) |#]

[#|2014-10-27T20:57:20.481-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=55;_ThreadName=Thread-11;_TimeMillis=1414468640481;_LevelValue=800;_MessageID=NCLS-CORE-00092;|   Server shutdown initiated|#]

[#|2014-10-27T20:57:20.498-0700|INFO|glassfish
4.1|javax.enterprise.bootstrap|_ThreadID=1;_ThreadName=main;_TimeMillis=1414468640498;_LevelValue=800;_MessageID=NCLS-BOOTSTRAP-00027;| Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@2c3b2e73 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@290bdbae.|#]

[#|2014-10-27T20:57:21.488-0700|INFO|glassfish
4.1|javax.enterprise.bootstrap|_ThreadID=55;_ThreadName=Thread-11;_TimeMillis=1414468641488;_LevelValue=800;_MessageID=NCLS-BOOTSTRAP-00028;| Unregistered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@2c3b2e73 from service registry.|#]

[#|2014-10-27T20:57:21.503-0700|INFO|glassfish
4.1||_ThreadID=55;_ThreadName=Thread-8;_TimeMillis=1414468641503;_LevelValue=800;| FileMonitoring shutdown|#]

[#|2014-10-27T20:57:21.904-0700|INFO|glassfish
4.1|javax.enterprise.system.core|_ThreadID=55;_ThreadName=Thread-11;_TimeMillis=1414468641904;_LevelValue=800;_MessageID=NCLS-CORE-00013;|   Shutdown procedure finished|#]


Command start-domain failed
Tiny
  • 24,933
  • 92
  • 299
  • 571
Richard Barker
  • 1,014
  • 1
  • 10
  • 28
  • Try providing some code or context if you want actual help. – Alex K Oct 28 '14 at 04:03
  • @KenY-N, can you post that as an answer? You deserve the credit for this one as that was the problem. It was the Tomcat that was killing the Glassfish. Not the Apache. – Richard Barker Oct 28 '14 at 14:56

1 Answers1

2

The important line in the error log is this:

java.net.BindException: Address already in use at sun.nio.ch.Net.bind0

This is most likely due to there already being another service (Apache, an old Tomcat installation, etc) using GlassFish's default port of 8080. The port that GlassFish uses can be changed by following the instructions here.

Furthermore, to find out what is already using GlassFish's port so you can stop the service if necessary, use this for Windows and this for Linux.

Community
  • 1
  • 1
Ken Y-N
  • 12,690
  • 21
  • 62
  • 98
  • For future users. If you wish to see if an application is bound to a port and your on linux you can use this command: sudo netstat -tulpn | grep port_number ----- so for my issue here I used sudo netstat -tulpn | grep 8080 followed by a kill command to make that process die. – Richard Barker Apr 03 '15 at 17:42