Category Archives: glassfish
Installing Glassfish 3.1 ubuntu
Install Java first!
sudo su apt-get install unzip wget http://dlc.sun.csom.edgesuite.net/glassfish/3.1/release/glassfish-3.1.zip sudo unzip glassfish-3.1.zip mv glassfish3 /opt useradd --system glassfish -d /opt/glassfishv3 chgrp -R admin /opt/glassfishv3 cd /opt/glassfish3 chmod -R +x bin/ cd bin ./asadmin start-domain domain1 cd /etc/init.d nano glassfish
(or you can use your favourite editor!)
GLASSFISHPATH=/opt/glassfish3/bin echo "starting glassfish from $GLASSFISHPATH" cd /opt/glassfish3/bin ./asadmin start-domain domain1
(PRESS CTRL X) Y (save)
sudo update-rc.d glassfish defaults chmod +x glassfish
And reboot to check it comes up.
http://youripaddress:4848/
Gotchas!
OpenJDK doesn’t seem to work you need to use the Java SDK
If you install java you may find that there is no link to it, change to the bin folder.
cd /bin
and create a link
ln -s /usr/lib/jvm/java-6-sun/jre/bin/java java
Netbeans Problem “Enable-secure-admin”
Gotcha 2 is when trying to connect Netbeans to the server and you get some message about Enable-secure-admin here’s how to fix it
run asadmin on the glass fish server in terminal execute the following:
a) enable-secure-admin
b) stop-domain domain1
c) start-domain domain1
d) list-domains
See: http://download.oracle.com/docs/cd/E18930_01/html/821-2435/gkofl.html
accept the certificate. If you type in ‘y’
Another Glassfish Gotcha!
Logs again folks.
We had a big system we deployed, got 23 users in it ran like a DOG, updated Glassfish 2.1.1 still ran like a dog (but didn’t crash with permgen problems).
What was happening was simple the web stack was writing hundreds of INFO statements about combos and drop downs. I set all the logs to only report SEVERE errors and it all sped up!
A couple of Glassfish Gotchas!
First Gotcha!
Logs! I had a server pulling 5.2 million records and joining them together from a set of database servers. Ran fine for about 2 weeks then fell over. Could I get it to work? No, thats because Glassfish servers have their logs set to rotate at 200000 k or something strange, which means the server just simply ran out of disk space… it was a console based Solaris box so it didn’t TELL me what was wrong!
Connections to the Database Server – If you have a lot of users make sure your maximum connections are set high enough in the EJB, if not you’ll find it works fine with 5 users but slows down or even breaks if not!
My application won’t deploy!
You know one of those problems that makes you kick yourself when you find out the solution!
I’ve got this Solaris server running Glassfish, the application runs fine locally, but when deploying it just hangs.
I THOUGHT it was a problem with a slow network, so just sat there waiting but nothing – had the network checked as well. Then one of my guys was dealing with a different problem (Uthay!) and started talking about JDK versions.
The application I had was configured as JDK 5, so I changed it to JDK 6 and guess what – it deployed straight away.
THere are two morals to this story:-
a. Listen to what is going on around you if you work in a programming team as someone elses solution might be yours as well.
b. Make sure the version of the JDK you are running on the development environment MATCHES the one on the server!