Fishes eyes
I’ve been following Glassfish with interest for a while now –
I want a Tomcat replacement: webapps, a connection pool and an admin
interface that doesn’t stink. Not much to ask.
Glassfish2 delivers all that in spades, plus clusters very nicely.
But it also has a lot of J(2)EE features that I’m not really interested in.
Glassfish v3s design follows a ‘microkernel’ model, which should mean its
a lot lighter, faster, and lets you mix and match the features you need.
It’s matured enough for me to give it a go.
Get it from https://glassfish.dev.java.net/downloads/v3-techPreview-2.html. The same ZIPfile runs on all platforms (I’m on a Macbook Pro).
cd ~/Applications
unzip ~/Downloads/gfv3-preview2.zip
PATH=$PATH:~/Applications/glassfishv3-tp2/bin
nice feature #1 : typo detection
hypnotoad:glassfishv3-tp2 $ ./bin/asadmin list-domain
Closest matching command(s):
list-domains
Remote server does not listen for requests on [localhost:8080].
Is the server up?
Command list-domain failed.
hypnotoad:glassfishv3-tp2 $ ./bin/asadmin list-domains
domain1
Command list-domains executed successfully.
nice feature #2 : boot time
hypnotoad:glassfishv3-tp2 $ time asadmin start-domain domain1
Command start-domain executed successfully.
real 0m1.029s
user 0m0.456s
sys 0m0.091s
nice feature #3 : not everyone needs an /admin webapp
First nice feature: open http://localhost:8080 and try
‘to manage the server, click here ‘. Glassfish gets the request for /admin,
realises it doesn’t have an admin webapp, and offers to install it whle U wait:
Once admingui.war downloads, it’s deployed and you get a login prompt.
Login as ‘anonymous’ (no password) and you get the usual admin screen -
as you can see there’s a lot less stuff in there by default.
nice feature #4 : you can deploy things to it
(In my experience, that’s not a given).
Just knock up a stub webapp in Netbeans ( here’s one I made earlier ) and deploy it:
hypnotoad:glassfishv3-tp2 $ time asadmin deploy ~/NetBeansProjects/hellonasty/dist/hellonasty.war
upload file successful: /private/tmp/gfv3/hellonasty.war
Command deploy executed successfully.
real 0m2.393s
user 0m0.288s
sys 0m0.071s
And here it is:
nice feature #5 : finally a use for that OSX 1.6 JVM
Guess you’ll need that admin webapp after all, as I couldn’t find the right
options to asadmin set-jvm-options to switch the default JDK:
(That starred box should say:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home)
hypnotoad:glassfishv3-tp2 $ ps ax|grep 1.6/Hom[e]
14709 s001 S 0:11.40 /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java -cp /Users/dick/Applications/glassfishv3-tp2/glassfish/modules/glassfish-10.0-tp-2-SNAPSHOT.jar
....
....
....
instancename server -embedded false -verbose false -domainname domain1
Making Java 6 the systemwide default should work too.
nice feature #6 : documentation
is at : http://docs.sun.com/app/docs/coll/1343.7
next steps
Seems to run OK to me, even though OS X isn’t listed as a supported platform yet.
There are a few features missing (asadmin list-commands is a lot shorter than on GFv2)
but I’m pretty pleased with it.
Next on the list : hook up NetBeans and JRuby and try deploying a database-backed Rails app.
I’ve just figured out how to get JavaDB and Glassfish to play nice.





