« EJB 3.0 and WebServi... | Main | Liferay, JSF and... »

Ubuntu 10.4, Glassfish V3 and Java.....

After I did an update of my Ubuntu from 9.10 to 10.4 my Glassfish V3 server did not work any more properly. The reason was that I used an older version of JDK and for some reasons after my update the things did not work together as they should. 

I found these usefull links:

http://forums.java.net/jive/thread.jspa?messageID=399990&#399990

and in a german ubuntu wiki:

http://wiki.ubuntuusers.de/Java/Installation 

Finally I solved my situation with the following steps:

  1. I updated my apt package sources adding the additional source for ubuntu 10.4 to get sun-java:
    deb http://archive.canonical.com/ lucid partner
  2. next I installed the sun-java6-jdk packages using apt
  3. now I switched my jdk in general using the following command (I have also still an OpenJDK intalled on my ubuntu):
    sudo update-java-alternatives -s java-6-sun

  4. And finally I changed a config File of my Glassfish V3 installation to start GF 3 with the Sun JDK
    • edit file:  [glassfishinstall]/glassfish/config/asenv.conf
    • change var AS_JAVA to point directly into the sun jdk
      AS_JAVA=/usr/lib/jvm/java-6-sun

Now everything works fine again. My Sun JDK is now

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)