Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish server does not start. NullPointeException

I just downloaded the GlassFish 5.0 archive - Full Platform, unzipped it, I run it through the command line.

asadmin start-domain

problem:

Exception in thread "main" java.lang.NullPointerException at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.initializeServiceLocator(AbstractModulesRegistryImpl.java:152) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.newServiceLocator(AbstractModulesRegistryImpl.java:144) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:218) at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.createServiceLocator(AbstractModulesRegistryImpl.java:224) at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceLocator(StaticModulesRegistry.java:88) at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContainer.java:217) at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContainer.java:255) at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:231) at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:371) at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306) at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57) 

I tried to set the path in the file asenv.bat -> set path = C:/.../Java/bin - did not help. Tried so to launch: asadmin start-domain domain1 - did not help.

Installed: jdk-9.0.1 Also tried on the 8th, did not help. What to do???

like image 333
Aleksandr Avatar asked Nov 23 '17 14:11

Aleksandr


People also ask

How do I fix NullPointerException in processing?

NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object. This error can be resolved by using a try-catch block or an if-else condition to check if a reference variable is null before dereferencing it.

How do I start a GlassFish server in Windows?

From the Windows Start menu, select the command for your distribution of GlassFish Server: If you are using the Full Platform, select Programs -> Oracle GlassFish Server -> Start Admin Server. If you are using the Web Profile, select Programs -> Oracle GlassFish Server Web Profile -> Start Admin Server.

Which JDK is compatible with GlassFish 5?

Required JDK Versions GlassFish Server Open Source Edition Release 5.0 requires Oracle JDK 8 Update 144 or later.


2 Answers

OK, Glassfish 5.1 doesn't exist for the moment. Continue with Glassfish 5.0 with this solution:

Just set the AS_JAVA variable in your asenv.bat file located here: C:\DEVENV\glassfish5\glassfish\config.

File to edit: add last line screenshot of code

Relaunch your server....enjoy : screenshot of relaunch command to start your server

like image 110
Vifier Lockla Avatar answered Sep 23 '22 06:09

Vifier Lockla


This looks to be this issue - https://github.com/eclipse-ee4j/glassfish/issues/22130.

GlassFish 5 does not work on JDK9, however GlassFish 6 works on JDK 11.

like image 36
Jonathan Coustick Avatar answered Sep 23 '22 06:09

Jonathan Coustick