Sunday, June 20, 2010

GlassFish Admin Console initPage Error in Ubuntu 10.04

Hello,

I spent a lot of time trying to get the GlassFish Admin Console working in Ubuntu 10.04... It was really hard to find good resources for a Linux beginner, let alone resources at all. So I figured I'd share my knowledge with the world. Hope this helps.

The specific problem here is when you are trying to bring up the Glass Fish Administration Console you get an error 500. Specifically, an 'initPage' error. See error below.

HTTP Status 500 -


type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.reflect.InvocationTargetException while attempting to process a 'initPage' event for '/login.jsf'.

root cause

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'initPage' event for '/login.jsf'.

root cause

java.lang.reflect.InvocationTargetException

root cause

java.lang.UnsupportedOperationException: Cannot create XMLStreamReader or XMLEventReader from a javax.xml.transform.stream.StreamSource

note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.


GlassFish v3






















I managed to fix this error and get the Admin Console up and running.

Follow the instructions below to update your JDK and point GlassFish to the proper version of the JDK. Restart the domain service and reload the admin console url. Hopefully this will help you along your way.


----------------------------------------------------------------
JDK
----------------------------------------------------------------

Turns out my problem was specific to the OpenJDK Build 18 (1.6.0_18) of the Java JDK. I ended up getting the admin console working with Sun's JDK, Build 20 (1.6.0_20).

To get the latest Sun build of the JDK...
  1. Make sure you repositories are up to date. Perform this command in a terminal window...
    sudo apt-get update
  2. To download and install the JRE (Java Runtime Environment)
    sudo apt-get install sun-java6-jre sun-java6-plugin
  3. To download and install the JDK (Java Development Kit)
    sudo apt-get install sun-java6-jdk sun-java6-plugin
  4. Once installed. Run this command to switch the active version of Java to Sun's version
    sudo update-java-alternatives -s java-6-sun
  5. You can check the version of Java, which is installed using...
    java -version
  6. You should get something similar to...
    java version "1.6.0_20"
    Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
    Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
Great! Now the Java JDK and JRE should be installed and you should be on Build 20.

----------------------------------------------------------------
GlassFish
----------------------------------------------------------------

The next hurdle that I had to jump over was updating a configuration file for GlassFish.

This was the "asenv.config" file which was still pointed to the old JDK version.

Replace this...
AS_JAVA=/usr/lib/jvm/java-6-openjdk

With...
AS_JAVA=/usr/lib/jvm/java-6-sun-1.6.0.20














Next you'll want to restart the GlassFish domain service...

##########
/glassfishv3/glassfish/bin$ bash asadmin

asadmin> start-domain
Waiting for DAS to start ......
Started domain: domain1
Domain location: /home/rbolton/glassfishv3/glassfish/domains/domain1
Log file: /home/rbolton/glassfishv3/glassfish/domains/domain1/logs/server.log
Admin port for the domain: 4848
Command start-domain executed successfully.
##########

After the service has started, open a web browser and go to the URL of the Admin Console.

http://localhost:4848/

----------------------------------------------------------------

Success!!! Can now load the Admin Console. :) Hopefully this will work for you as well. Please e-mail me or comment on this blog if you have any problems and I will try to help.
















Additional Resources:



Saturday, January 9, 2010

YouTube Education

For anyone interested, there is free education videos area out there on YouTube.


A good friend of mine Phil H., turned me onto this. You can watch lectures from various universities on a broad range of topics.

For example:
There are some great physics lectures from Berkley and MIT



















Blink

Blink by Malcom Gladwell

Blink was a Christmas present from my wife Kate. It was recommended by my good friend and mentor Chris O.

I thought this book was fabulous. The technique of making snap decisions and instant judgments is wonderfully explained in Blink. The cognitive research is very interesting, to say the least. There are lots of good short-story examples that help to understand the art form in many different scenarios/settings.

This is a great book to read for people in business or sales. I look forward to reading Malcom's other book, "The Tipping Point.

---

Many Lives, Many Masters

Many Lives, Many Masters by Brian Weiss, M.D.

"Many Lives, Many Masters" was a great read! If the accounts are true (which I believe they were), then there is a lot to think about with regard to life after death. Very neat stuff to think about! Dr. Weiss recounts the treatment of his patient Catherine, who is able to recall past live experiences and communicate with the "Master Minds". By undergoing hypnosis she was able to recollect all of these events and also recover from the anxieties that have been plaguing her. I think I read this book in record time (2 evenings), as it was impossible to put the book down once I picked it up. :)

---