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’

 

 

Advertisements

About Paul C

I am a Senior Java programmer/Web Technologies, Play in a band called Mandolin Monday, I have a cat and I live on a boat.

Posted on August 9, 2011, in glassfish, Howto. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: