GlassFish Server启动失败求助:NetBeans运行项目报错
解决GlassFish Server启动失败(未设置管理员账号密码)的问题
问题场景
在NetBeans IDE中运行项目时,弹出标题为“information”的对话框,提示:
glassfish server start failed please check server admin user name and password properties also please check the server log file for other possible causes
未给GlassFish Server设置过任何用户名或密码,日志路径C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\logs下仅能看到INFO级别的JVM启动命令行日志(日志内容见下方)。
日志内容
[2022-08-09T23:05:31.163+0300] [] [INFO] [NCLS-GFLAUNCHER-00005] [jakarta.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1660075531163] [levelValue: 800] [[ JVM invocation command line: C:\Program Files\Java\jdk-18.0.1.1\bin\java.exe -cp C:/Users/Robert Mdee/glassfish6/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:NewRatio=2 -Xmx512m -Xbootclasspath/a:C:\Users\Robert Mdee\glassfish6\glassfish\lib\grizzly-npn-api.jar --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -javaagent:C:/Users/Robert Mdee/glassfish6/glassfish/lib/monitor/flashlight-agent.jar -Djava.awt.headless=true -Djdk.corba.allowOutputStreamSubclass=true -Djdk.tls.rejectClientInitiatedRenegotiation=true -Djavax.xml.accessExternalSchema=all -Djava.security.policy=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\server.policy -Djava.security.auth.login.config=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\login.conf -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djavax.net.ssl.keyStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\keystore.jks -Djavax.net.ssl.trustStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\cacerts.jks -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall -Dosgi.shell.telnet.port=6666 -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 -Dgosh.args=--nointeractive -Dfelix.fileinstall.dir=C:\Users\Robert Mdee\glassfish6\glassfish\modules\autostart/ -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true -Dcom.ctc.wstx.returnNullForDefaultNamespace=true -Dcom.sun.aas.instanceRoot=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1 -Dcom.sun.aas.installRoot=C:\Users\Robert Mdee\glassfish6\glassfish -Djava.library.path=C:/Users/Robert Mdee/glassfish6/glassfish/lib;C:/Program Files/Java/jdk-18.0.1.1/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/Program Files/Java/jdk-17/bin;C:/Program Files/Java/jdk-16.0.2/bin;C:/Program Files/Common Files/Oracle/Java/javapath;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Windows/System32/OpenSSH;C:/Program Files/MiKTeX 2.9/miktex/bin/x64;C:/Program Files/MySQL/MySQL Shell 8.0/bin;C:/Users/Robert Mdee/AppData/Local/Microsoft/WindowsApps;C:/Users/Robert Mdee/glassfish6/glassfish/bin com.sun.enterprise.glassfish.bootstrap.ASMain -upgrade false -domaindir C:/Users/Robert Mdee/glassfish6/glassfish/domains/domain1 -read-stdin true -asadmin-args --host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--watchdog=false,,,--debug=false,,,--domaindir,,,C:\Users\Robert Mdee\glassfish6\glassfish\domains,,,domain1 -domainname domain1 -instancename server -type DAS -verbose false -asadmin-classpath C:/Users/Robert Mdee/glassfish6/glassfish/lib/client/appserver-cli.jar -debug false -asadmin-classname com.sun.enterprise.admin.cli.AdminMain]] [2022-08-09T23:15:49.174+0300] [] [INFO] [NCLS-GFLAUNCHER-00005] [jakarta.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1660076149174] [levelValue: 800] [[ JVM invocation command line: C:\Program Files\Java\jdk-18.0.1.1\bin\java.exe -cp C:/Users/Robert Mdee/glassfish6/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:NewRatio=2 -Xmx512m -Xbootclasspath/a:C:\Users\Robert Mdee\glassfish6\glassfish\lib\grizzly-npn-api.jar --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -javaagent:C:/Users/Robert Mdee/glassfish6/glassfish/lib/monitor/flashlight-agent.jar -Djava.awt.headless=true -Djdk.corba.allowOutputStreamSubclass=true -Djdk.tls.rejectClientInitiatedRenegotiation=true -Djavax.xml.accessExternalSchema=all -Djava.security.policy=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\server.policy -Djava.security.auth.login.config=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\login.conf -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djavax.net.ssl.keyStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\keystore.jks -Djavax.net.ssl.trustStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\cacerts.jks -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall -Dosgi.shell.telnet.port=6666 -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 -Dgosh.args=--nointeractive -Dfelix.fileinstall.dir=C:\Users\Robert Mdee\glassfish6\glassfish\modules\autostart/ -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true -Dcom.ctc.wstx.returnNullForDefaultNamespace=true -Dcom.sun.aas.instanceRoot=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1 -Dcom.sun.aas.installRoot=C:\Users\Robert Mdee\glassfish6\glassfish -Djava.library.path=C:/Users/Robert Mdee/glassfish6/glassfish/lib;C:/Program Files/Java/jdk-18.0.1.1/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/Program Files/Java/jdk-17/bin;C:/Program Files/Java/jdk-16.0.2/bin;C:/Program Files/Common Files/Oracle/Java/javapath;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Windows/System32/OpenSSH;C:/Program Files/MiKTeX 2.9/miktex/bin/x64;C:/Program Files/MySQL/MySQL Shell 8.0/bin;C:/Users/Robert Mdee/AppData/Local/Microsoft/WindowsApps;C:/Users/Robert Mdee/glassfish6/bin com.sun.enterprise.glassfish.bootstrap.ASMain -upgrade false -domaindir C:/Users/Robert Mdee/glassfish6/glassfish/domains/domain1 -read-stdin true -asadmin-args --host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--watchdog=false,,,--debug=false,,,--domaindir,,,C:\Users\Robert Mdee\glassfish6\glassfish\domains,,,domain1 -domainname domain1 -instancename server -type DAS -verbose false -asadmin-classpath C:/Users/Robert Mdee/glassfish6/glassfish/lib/client/appserver-cli.jar -debug false -asadmin-classname com.sun.enterprise.admin.cli.AdminMain]] [2022-08-09T23:18:16.179+0300] [] [INFO] [NCLS-GFLAUNCHER-00005] [jakarta.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1660076296179] [levelValue: 800] [[ JVM invocation command line: C:\Program Files\Java\jdk-18.0.1.1\bin\java.exe -cp C:/Users/Robert Mdee/glassfish6/glassfish/modules/glassfish.jar -XX:+UnlockDiagnosticVMOptions -XX:NewRatio=2 -Xmx512m -Xbootclasspath/a:C:\Users\Robert Mdee\glassfish6\glassfish\lib\grizzly-npn-api.jar --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -javaagent:C:/Users/Robert Mdee/glassfish6/glassfish/lib/monitor/flashlight-agent.jar -Djava.awt.headless=true -Djdk.corba.allowOutputStreamSubclass=true -Djdk.tls.rejectClientInitiatedRenegotiation=true -Djavax.xml.accessExternalSchema=all -Djava.security.policy=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\server.policy -Djava.security.auth.login.config=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\login.conf -Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as -Djavax.net.ssl.keyStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\keystore.jks -Djavax.net.ssl.trustStore=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1\config\cacerts.jks -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -DANTLR_USE_DIRECT_CLASS_LOADING=true -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall -Dosgi.shell.telnet.port=6666 -Dosgi.shell.telnet.maxconn=1 -Dosgi.shell.telnet.ip=127.0.0.1 -Dgosh.args=--nointeractive -Dfelix.fileinstall.dir=C:\Users\Robert Mdee\glassfish6\glassfish\modules\autostart/ -Dfelix.fileinstall.poll=5000 -Dfelix.fileinstall.log.level=2 -Dfelix.fileinstall.bundles.new.start=true -Dfelix.fileinstall.bundles.startTransient=true -Dfelix.fileinstall.disableConfigSave=false -Dorg.glassfish.gmbal.no.multipleUpperBoundsException=true -Dcom.ctc.wstx.returnNullForDefaultNamespace=true -Dcom.sun.aas.instanceRoot=C:\Users\Robert Mdee\glassfish6\glassfish\domains\domain1 -Dcom.sun.aas.installRoot=C:\Users\Robert Mdee\glassfish6\glassfish -Djava.library.path=C:/Users/Robert Mdee/glassfish6/glassfish/lib;C:/Program Files/Java/jdk-18.0.1.1/bin;C:/Windows/Sun/Java/bin;C:/Windows/System32;C:/Windows;C:/Program Files/Java/jdk-17/bin;C:/Program Files/Java/jdk-16.0.2/bin;C:/Program Files/Common Files/Oracle/Java/javapath;C:/Windows/System32/wbem;C:/Windows/System32/WindowsPowerShell/v1.0;C:/Windows/System32/OpenSSH;C:/Program Files/MiKTeX 2.9/miktex/bin/x64;C:/Program Files/MySQL/MySQL Shell 8.0/bin;C:/Users/Robert Mdee/AppData/Local/Microsoft/WindowsApps;C:/Users/Robert Mdee/glassfish6/bin com.sun.enterprise.glassfish.bootstrap.ASMain -upgrade false -domaindir C:/Users/Robert Mdee/glassfish6/glassfish/domains/domain1 -read-stdin true -asadmin-args --host,,,localhost,,,--port,,,4848,,,--secure=false,,,--terse=false,,,--echo=false,,,--interactive=true,,,start-domain,,,--verbose=false,,,--watchdog=false,,,--debug=false,,,--domaindir,,,C:\Users\Robert Mdee\glassfish6\glassfish\domains,,,domain1 -domainname domain1 -instancename server -type DAS -verbose false -asadmin-classpath C:/Users/Robert Mdee/glassfish6/glassfish/lib/client/appserver-cli.jar -debug false -asadmin-classname com.sun.enterprise.admin.cli.AdminMain]]
解决方案
1. 重置GlassFish管理员账号密码
即使未手动设置过,GlassFish默认可能存在隐藏初始化密码或配置异常,直接重置即可:
- 打开命令提示符(CMD),切换到GlassFish的bin目录:
cd C:\Users\Robert Mdee\glassfish6\glassfish\bin - 执行重置命令:
asadmin change-admin-password - 按提示操作:
- 输入域名(默认是
domain1),直接回车 - 旧密码处直接回车(未设置
- 输入域名(默认是
相关产品推荐
相关产品推荐

