出现的问题是
报错行是:
此时服务器的状态是:
正常的服务器的状态是:
正常启动服务器时,GlassFish Server窗口显示:
Launching GlassFish on Felix platform 四月 01, 2018 10:34:43 下午 com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner createBundleProvisioner 信息: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner. 四月 01, 2018 10:34:43 下午 com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations 警告: Skipping entry because it is not an absolute URI. 四月 01, 2018 10:34:43 下午 com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner$DefaultCustomizer getLocations 警告: Skipping entry because it is not an absolute URI. Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime@7d513edb in service registry. Found populator: com.sun.enterprise.v3.server.GFDomainXml #!## LogManagerService.postConstruct : rootFolder=D:\SoftWare\glassfish4\glassfish #!## LogManagerService.postConstruct : templateDir=D:\SoftWare\glassfish4\glassfish\lib\templates #!## LogManagerService.postConstruct : src=D:\SoftWare\glassfish4\glassfish\lib\templates\logging.properties #!## LogManagerService.postConstruct : dest=D:\SoftWare\glassfish4\glassfish\domains\domain1\config\logging.properties 信息: Running GlassFish Version: GlassFish Server Open Source Edition 4.1 (build 13) 信息: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter 信息: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. 信息: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created. 信息: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created. 信息: Authorization Service has successfully initialized. 信息: HV000001: Hibernate Validator 5.0.0.Final 信息: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry 信息: Grizzly Framework 2.3.15 started in: 1,460ms - bound to [/0.0.0.0:8080] 信息: Grizzly Framework 2.3.15 started in: 3ms - bound to [/0.0.0.0:8181] 信息: Grizzly Framework 2.3.15 started in: 4ms - bound to [/0.0.0.0:4848] 信息: Grizzly Framework 2.3.15 started in: 4ms - bound to [/0.0.0.0:3700] 信息: GlassFish Server Open Source Edition 4.1 (13) startup time : Felix (9,184ms), startup services(6,830ms), total(16,014ms) 信息: Grizzly Framework 2.3.15 started in: 2ms - bound to [/0.0.0.0:7676] 信息: Grizzly Framework 2.3.15 started in: 369ms - bound to [/0.0.0.0:8181] 信息: Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@610d28b8 as OSGi service registration: org.apache.felix.framework.ServiceRegistrationImpl@682abca7. 信息: Grizzly Framework 2.3.15 started in: 3ms - bound to [/0.0.0.0:8080] 信息: JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://2011-20131227SJ:8686/jndi/rmi://2011-20131227SJ:8686/jmxrmi
正常的情况下 GlassFish Server节点下应该还会有多个子节点,而出现上述状况时,GlassFish下就没有任何节点了。因此只需要删除这个服务器再重装就行。
重装方法见:https://yq.aliyun.com/articles/35444
PS. 一种稍微简单的方法是,备份一个GlassFish,以后再遇到这种问题时,只用将坏掉的GlassFish目录下的glassfish替换成备份中的就行。
2018/5/29更新:出现上述状况时,一般是关闭Netbeans再打开时服务器出了问题,所以我们只需要在打开Netbeans之前去替换那个坏掉的glassfish文件即可,然后再打开Netbeans就可以直接运行了。
这个glassfish有100多M,替换的时候会有一些慢,所以我又定位到导致这个问题的原因的文件夹是glassfish下的domains文件夹,因此,现在最方便的解决方法是在每次关闭又启动Netbeans之间那段时间,我们先行使用备份的glassfish文件夹下的domains文件替换掉我们正在使用的glassfish服务器下的domains文件夹,之后再打开Netbeans就可以了。
当然这种方法只是治标不治本的。
ps. 听同学说重装NetBeans可以彻底解决这个问题