我收到以下错误。任何帮助将不胜感激。
$ 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
答案 0 :(得分:2)
错误日志中的重要一行是:
java.net.BindException:sun.nio.ch.Net.bind0上已经使用的地址
这很可能是由于使用GlassFish的默认端口8080已经存在另一项服务(Apache,旧的Tomcat安装等).GlassFish使用的端口可以由following the instructions here更改。
此外,要找出已使用GlassFish端口的内容,以便在必要时停止服务,请使用this for Windows和this for Linux。