安装后无法启动 Glassfish,Ubuntu 18.04
Cannot start Glassfish after install, Ubuntu 18.04
我正在尝试在 Ubuntu 18.04 LTS 机器上安装 Glassfish 5.1,但在启动服务时出现以下错误:
oct 28 00:47:13 Valhalla sudo[4132]: pam_unix(sudo:session): session opened for user root by (uid=0)
oct 28 00:47:13 Valhalla systemd[1]: Starting GlassFish Server v5.0...
-- Subject: Unit glassfish.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit glassfish.service has begun starting up.
oct 28 00:47:15 Valhalla asadmin[4135]: Exception in thread "main" java.lang.NullPointerException
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
oct 28 00:47:15 Valhalla asadmin[4135]: at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
oct 28 00:47:15 Valhalla systemd[1]: glassfish.service: Control process exited, code=exited status=1
oct 28 00:47:15 Valhalla systemd[1]: glassfish.service: Failed with result 'exit-code'.
oct 28 00:47:15 Valhalla systemd[1]: Failed to start GlassFish Server v5.0.
sudo java -version
结果如下:
openjdk 11.0.9 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.18.04.1)
OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.18.04.1, mixed mode, sharing)
我正在按照找到的安装说明进行操作 here(唯一未遵循的说明是 Java 8 的安装,不确定 Glassfish 是否不能与其他版本兼容)。
我也在运行Apache/2.4.29 (Ubuntu) 80端口
提前感谢您的见解和建议。
问题很可能是由于您的 java 版本,您使用的是 OpenJDK 而 Glassfish 需要 Oracle JDK .
Eclipse GlassFish Server Release 5.1 requires Oracle JDK 8 Update 144
or later.
官方doc.
我正在尝试在 Ubuntu 18.04 LTS 机器上安装 Glassfish 5.1,但在启动服务时出现以下错误:
oct 28 00:47:13 Valhalla sudo[4132]: pam_unix(sudo:session): session opened for user root by (uid=0)
oct 28 00:47:13 Valhalla systemd[1]: Starting GlassFish Server v5.0...
-- Subject: Unit glassfish.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit glassfish.service has begun starting up.
oct 28 00:47:15 Valhalla asadmin[4135]: Exception in thread "main" java.lang.NullPointerException
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371)
oct 28 00:47:15 Valhalla asadmin[4135]: at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
oct 28 00:47:15 Valhalla asadmin[4135]: at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)
oct 28 00:47:15 Valhalla systemd[1]: glassfish.service: Control process exited, code=exited status=1
oct 28 00:47:15 Valhalla systemd[1]: glassfish.service: Failed with result 'exit-code'.
oct 28 00:47:15 Valhalla systemd[1]: Failed to start GlassFish Server v5.0.
sudo java -version
结果如下:
openjdk 11.0.9 2020-10-20
OpenJDK Runtime Environment (build 11.0.9+11-Ubuntu-0ubuntu1.18.04.1)
OpenJDK 64-Bit Server VM (build 11.0.9+11-Ubuntu-0ubuntu1.18.04.1, mixed mode, sharing)
我正在按照找到的安装说明进行操作 here(唯一未遵循的说明是 Java 8 的安装,不确定 Glassfish 是否不能与其他版本兼容)。
我也在运行Apache/2.4.29 (Ubuntu) 80端口
提前感谢您的见解和建议。
问题很可能是由于您的 java 版本,您使用的是 OpenJDK 而 Glassfish 需要 Oracle JDK .
Eclipse GlassFish Server Release 5.1 requires Oracle JDK 8 Update 144 or later.
官方doc.