0

I changed my default jre to jdk 1.7x in eclipse kepler. I was getting a null pointer exception when I started glassfish 4. To fix this issue, I did all the steps to change the jre/jdk of my glassfish. On the final screen, when I click finish, nothing happens. This looks like a bug in the software. Please help me to fix my problem.

enter image description here

Note: When I try to clean the server using my server > right click > clean, I get the same null pointer exception again.

Edit- I tried one solution which does not help:

Apparently when Glassfish is installed it hard-codes its reference to your JDK location, so to fix this problem I ended up having to edit a file named asenv.bat. In short, I edited this file:

C:\glassfish\config\asenv.bat.

and I commented out the reference to JDK 6 and added a new reference to JDK 5, like this:

REM set AS_JAVA=C:\Program Files\Java\jdk1.6.0_04\jre/..
set AS_JAVA=C:\Program Files\Java\jdk1.5.0_16

This solved the problem, and Glassfish started right up after this change.

But my asenv.dat file contains no such path. Anyway, I added set AS_JAVA = my jdk path here and it did not help.

set AS_IMQ_LIB=..\..\mq\lib
set AS_IMQ_BIN=..\..\mq\bin
set AS_CONFIG=..\config
set AS_INSTALL=..
set AS_DEF_DOMAINS_PATH=..\domains
set AS_DEF_NODES_PATH=..\nodes
set AS_DERBY_INSTALL=..\..\javadb
REM I added my line here

Another solution which leaves me with the same problem: Install latest eclipse luna with latest glassfish 4.

enter image description here

james
  • 1,667
  • 5
  • 26
  • 38

4 Answers4

1

It is a bug - see here the comment by BalusC

The only sure way to workaround is to delete your server runtime and create it anew.

And by the way - Luna is the latest eclipse release - maybe update ?

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
  • I deleted it and create it anew. I even re added my jdk with a new name. It did not help. I am trying to get luna now and reinstalling glassfish. – james Jul 27 '14 at 23:18
  • I created my environment from scratch. Still no luck. Is glassfish really this crappy ? I never faced these issues with tomcat or weblogic. – james Jul 28 '14 at 00:09
  • @james: You are hitting in the dark - calm down. Explain what you did _exactly_. What is the invalid JRE in the picture ? – Mr_and_Mrs_D Jul 28 '14 at 00:23
  • It is the jdk 64 bit in program files folder of windows 7 64 bit. It worked before and on other computers, but not anymore. – james Jul 28 '14 at 00:43
0

First, delete the glassfish server in servers window in eclipse. Then, in my second screenshot, in the window below the front window, i.e where you see Invalid JRE in red, delete the glassfish server. Then, recreate a glassfish server from the servers window from scratch. Your problem will be solved. I had also reinstalled my jdk, so I am not sure if that also helps. Anyway the glassfish server is atleast running now.

james
  • 1,667
  • 5
  • 26
  • 38
0

Here is the Answer :

Glass-fish Requires JDK , somehow it is unable to get it. We can solve this issue just click on the JRE preference link. And add one more entry of JDK in that popup window. Now you should be able to select & proceed further with the Glass-fish installation.

0

Save the server and try to add a new module again.

See more: https://www.eclipse.org/forums/index.php/t/1072242/