Hello,
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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjjHnPhp7RpXbcBLaLF1lmpdFRBs7B9VJ7c7_8E1mXTgPdewOrQdDsKdcg8Hoavng6cBiUWOElR2P6wvTJQwN6D5nWoM5Kh735gk1fDc7WV_nZaEpd3fQ2kcDcGmgS9Ylv8YOdbZimVGNe/s320/GlassFish-Loading.png)
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.
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...
- Make sure you repositories are up to date. Perform this command in a terminal window...
sudo apt-get update - To download and install the JRE (Java Runtime Environment)
sudo apt-get install sun-java6-jre sun-java6-plugin - To download and install the JDK (Java Development Kit)
sudo apt-get install sun-java6-jdk sun-java6-plugin - Once installed. Run this command to switch the active version of Java to Sun's version
sudo update-java-alternatives -s java-6-sun - You can check the version of Java, which is installed using...
java -version - 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.
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
##########
/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:
Thanks get post I had this working on my laptop and was trying to get it working on my desktop.
ReplyDeleteI forgot to amend asenv.config.
Thank you!!!! but in ubuntu you forget to say "enable the parthner repository in /etc/apt/source.list", if you don't make this modify the package sun-java-jdk not apperar in apt get :)
ReplyDeletemany thanks!
No problem. Glad I was able to help even if it was only a little bit. :)
ReplyDeleteThank you, it really helped.
ReplyDeleteBy the way GF configuration file is asenv.conf and not asenv.config.
Thanks a lot. Saved me some hours of work ;)
ReplyDeleteThanks for the tip!
ReplyDeleteCool bananas!
Nick
Awesome man !
ReplyDeletegrande master grande!!!!, tenia instalado esto en windows y me pasaba algo similar, ahora instale ubuntu y me daba lo mismo... me queria matar!!!! je.
ReplyDeleteAhora anda al pelo.
Damn Ubuntu, ty for posting this.
ReplyDeleteit's works!
ReplyDeleteFunciono, muchas gracias. sabia que tenia que cambiar eso pero en mi archivo no estaba esa entrada.
Saludos!
Thank you very much for this!
ReplyDeleteAfter an Ubuntu update my GlassFish didn't work anymore, because the update changed java to OpenJDK... :/
Thanks a lot! You saved my Sunday afternoon
ReplyDeleteThanks for that tip!!
ReplyDeleteIt's time to deploy some app and check this out!
Great stuff thanks - even though this is an old post, it's still valid. Although I am on a Debian server, so I had to add this line to /etc/apt/source.list:
ReplyDeletedeb http://ftp.pl.debian.org/debian/ squeeze non-free
After that I could install Sun (Oracle) Java and I didn't need to add the specific java to my conf file. Just a restart of the Glassfish server and it worked. :-)