简体   繁体   中英

Cannot start Glassfish after install, Ubuntu 18.04

I am trying to install Glassfish 5.1 on an Ubuntu 18.04 LTS box, but I get the following error when starting the service:

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.

The result of sudo java -version is as follows:

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)

I am following the install instructions found here (Only instruction not followed was the installation of Java 8, not sure if Glassfish doesn't play nice with other versions).

I am also running Apache/2.4.29 (Ubuntu) on port 80.

Thank you in advance for your insights and advice.

The problem is most probably due to your java version, you are using OpenJDK while Glassfish needs Oracle JDK .

Eclipse GlassFish Server Release 5.1 requires Oracle JDK 8 Update 144 or later.

Official doc .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM