Yesterday i downloaded GlassFish 5.0 and JDK9. When I'm trying to run server with asadmin start-domain
GlassFish send to me exception
When I try to use "asadmin start-domainAfter" I got respond: "Remote server does not listen request on [localhost 4848]. Is the serwer up?"
Any can help me with this? I looked for solution at google, I tried kill process using port 4848, change port 4848 in domain.xml on another one, nothing helps.
It's my firts time with glassfish I don't know what to do. Anyone can help me?
I'm working at windows 7, InteliJ Ultimate 2017.2.4, JRE 1.8 and JDK 9.
GlassFish 5.0 not starting on JDK 9 is a known issue.
GlassFish 5.0 is certified only on JDK 8 (u144) as stated in the release notes: https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf
If you are on a mac or linux machine, add the following to
config/asenv.conf
in your glassfish installation directory.set AS_JAVA="path to your jdk 8"
For example, in Mac OS it will be
JDK 9 should be supported in the next update, i.e. GlassFish 5.0.1 See end of https://blogs.oracle.com/theaquarium/java-ee-8-is-final-and-glassfish-50-is-released
I use Windows 10 and I have installed JDK and JRE for version 9 and 8u141, 8u151, 8u144 (installed for test about this problem) For exception I had had the same problem : the command "asadmin start-version" throw an exception.
Just check the version from CMD console :
Problem JAVA_HOME and PATH environment viariables are JDK8u151 ???
To solve the problem, the documentation advice that :
Alternatively, you can specifically set the Java path with the AS_JAVA property in the in the as-install/config/asenv.conf file.
Consequently, I add the last line below :
Relaunch CMD console and start server with asadmin start-domain : it works properly....enjoy.
Anyone having problems with NullPointerException, look out for your system PATH Variables. Be sure that they point to an acceptable JDK (As it was said before: GlassFish 5.0 is certified only to work on JDK 8u144). This NullPointerException is caused by using an incompartible JDK as mentioned here: https://docs.oracle.com/cd/E19226-01/820-7688/gipqi/index.html
In my case the PATH variable was correctly pointing to java8u144 bin, but my PATH also contained a pointer to
C:\ProgramData\Oracle\Java\javapath
. And someway an old version of java SDK was stored on\ProgramData\Oracle
so GlassFish was using this old version of java as SDK.