Sunday, 31 May 2009

Enter the Glassfish

Okay I didn't want to admit it but the whole Grails/JDO thing turned out to be a pain. The Google hosting plan sounded awesome but what I found was that trying to recode my all ready underdone project was an exercise in futility. Therefore I had to think about other hosting solutions. I thought briefly about Grails Podcast sponsor Morph Labs only to find out that free developer accounts had just been discontinued. Really the only feasible solution was to host it myself.

I had previously set up dynamic dns server as my ISP doesn't have static ip's (unless you pay more of course), so only had to think about an App Server. Based on a friend's experiences and recommendation I decided to give Glassfish a try. Given the early adopter issues I had with Google App Engine I chose V2.1 over the V3 prelude (what's a prelude anyway?).

Set up was relatively easy as there are plenty of guides on the web. After grails war I was away. There were a couple of things that needed addressing though:
  • url contained port number
  • only using hsql file based db
The first issue was addressed with the virtual server in my router by changing all incoming port 80 requests to 8080 for the app server. The second was a little trickier. If I changed the db to mysql or postgresql or whatever, I didn't want to store the db username and password in the datasources config file of my project because being open sources any one could access it. Using advice from the great grails sage I've used a jndi datasource and all is good. Setting this up was also fairly straight forward and all is working well.

Whilst I would like to go back to GAE at some stage, I have definitely learned quite a bit from having my own app server and think that until the project is completely finished I'll keep with Glassfish. After that maybe I look at porting it over again. Next big thing for this app will be security. At this point I'm thinking of using the JSecurity plugin so will let you know how it all goes.

2 comments:

Marcel Overdijk said...

Hi Dean,

What was your main reason not to go with Google app engine?
I'm considering using it myself.

Cheers,
Marcel

Dean said...

Hey Marcel,
My main problem was converting to JDO. Initially I thought all my existing code would just work with the plugin but I had trouble generating views and controllers (I believe this has now been fixed with the latest plugin).
I'd like to give it another go but will wait until the current project is finished and then look at converting to JDO.

Regards,
Dean