first look at GF3
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.
Get nekkid!
In case you were wondering, today is CSS Naked Day. Wordpress holds up pretty well. By an amazing coincidence, I saw a fat monkey today. And he looked just like you.
this site best viewed in…
This mornings WebKit nightly build rendering the Acid3 test:
And look! Firefox painted me a beautiful picture too:
That’s lovely, sweetheart.
Guess who’s not regretting switching a couple of months back.To be fair, Opera apparently scores very highly too (both its users must be delighted).
portal on OSX under Crossover
Unless you live under the sea, you know a few ways to run windows apps on a Mac. Obviously, the only ‘windows apps’ worth having are games, which means DirectX support. Options include:
- BootCamp is pretty fast, but rebooting into windows is no way to spend your time.
- Parallels somehow trashed my BootCamp partition. We hates it.
- VMware Fusion has DirectX support, and Unity mode (which lets apps run in ‘native’ windows).
a golden hammer to crack a nut
VMware runs a full Windows install, which has plenty of downsides:
- you waste a windows install worth of disk space (a big deal on a laptop)
- you waste a lot of ram running another OS
- windows needs baby sitting : patching, virus scanning
- you need a windows license
- you need a VMware license
- (pet hate) my Dvorak keyboard layout, trackpad gestures etc. don’t carry over into VMware
The real problem here is that I’m using a virtualized OS to run 1 program.
I’d argue that most people don’t want a Windows installation, they just need to run a few Windows apps (I’d also argue that’s true on non VMed Windows machines, but that’s another rant).
merlot the magician
WINE is an implementation of the win32 APIs on *NIX. Instead of a VM, you just run .EXEs on your UNIX machine.
Back in my NetBSD days, I used it to run things like Morpheus and Kazaa - setup was a bit fiddly, but performance was good and it saved me having to reboot.
Crossover is a commercial app that lets you run multiple WINE ‘bottles’ (essentially a directory tree and a config file). There’s a free 30 day trial and it supports Steam, so thought I’d try it out. Choose ‘Steam’ from the list of supported apps, Crossover makes a new bottle for it, installs some fonts and off we go:
After creating a Steam account, it set off and downloaded Portal from the Net. Installation couldn’t have been easier, and Crossover plays nicely with OSX - clicking links in the Steam app opens webpages in Safari, for example. Hardware support is impressive - the microphone works fine, for example :
cd install gotcha
When you insert a Windows CD, Crossover runs Setup.exe and builds a bottle for the app on the fly.
You can get stuck at the ‘please insert disk 2’ messages; OSX can’t eject because Crossover has the disk in use.
Just open Terminal.app and run ‘sudo umount -f /Volumes/Orange\ Box’.Then hit F12 to eject the disk, put in disk 2 and let OSX remount it.
tweak settings
I run it windowed because I want to see my desktop (otherwise I might as well BootCamp and be done). A nice man has some very useful launch options for Orange Box on a Macbook - my Macbook Pro seemed happy with :
-heapsize 512000 -width 1440 -height 900 –window -novid
you will be baked, and then there will be cake
Crossover costs around 30 quid with an education discount.
Civ4 for mac is 40 quid (and no cheaper on ebay). Windows Civ4 is about a tenner. So Crossover and Civ4 pays for itself, whether or not you get Windows for free. A few of my old PC games look like they’d work too.
I’d rather buy native Mac games where possible, but this is seems like a good solid fallback.
why I hate your freedom
Happy New Thing.
So anyway, Adam Leventhal found out AAPL hamstrung DTrace w.r.t. certain apps on Leopard (iTunes at least). Cue inevitable Slashdottian outrage.
When source code gets released under a license everyone (so long as they follow those terms) gets to port, extend, or shout about how your license isn’t free at all really. They can even choose to ignore you, or to provide really shitty implementations. None of the above makes them ‘evil’.
Some of OS X is open source, some is proprietary, and some is riddled with DRM. iTunes is in the last category. It’s Apples main cash cow; if it was reverse engineered they’d lose a competitive advantage, scare their movie/music business partners away, and the terrorists would win.
OSX ships with a full toolchain and part of that is Instruments - a GarageBand-like frontend to DTrace. It’ll probably be the first contact with DTrace a lot of coders get. I’ve only tinkered with it, but right away you can see why it’d make DRM fans twitchy. Running iPhoto under Instruments let me see down into the Cocoa API calls. I now know how atomic preference changes are implemented at the system call level. Basically, it’s fucking great.
It was really nice of Apple to give it out for free, just like it was nice of Sun to give us DTrace, ZFS and NFS. Telling either company how they should release any of those products makes you a bit of a deRaadt in my book.





