Skip to content

Software Development Section

I have decided (it probably won’t last) to actually put some useful content on this site. Up to now being not about much was a good description. So I have started by adding a Software Development Section where I will start adding a number of my thoughts on all things Software related. It may or may not be useful but I felt it could be an interesting thing to do.I decided as an experiment to host it on Google Sites (which I have as part of Google Applications for my Domain).  This used to be JOT which was excellent Wiki Software - unfortunately they have broken a number of the really useful features of Wiki’s  (such as wiki linking).  

Java apps on Webfaction.com

I use webfaction.com to host gidley.co.uk and I notice they have started letting us run any application. So finally this may let me use Java for bits of my own website. To date I haven’t done this as java app hosting is much more expensive than PHP.

I have decided to use Jetty and see how hard it is to get going.

Steps

  • Create a custom application - this tells you the folder and port to use.
  • Download Sun JDK 1.6 (the bin version) and upload it to webfaction
  • Download Jetty and upload it to webfaction
  • Edit jetty.xml and set
    • The TCP Port to be the assigned port (from webfaction control panel)
    • You may want to disable request logging by removing references to it
  • Create a script to start jetty - make sure you set the -Xmx parameter to be less than your hosting plan.

    #!/bin/bash
    JAVA_OPTS=-Xmx64M
    JETTY_HOME=/home2/bgidley/webapps/webtide/jetty
    JAVA_HOME=/home2/bgidley/webapps/webtide/jdk
    TEST=`pgrep java -u bgidley`#if [ $(ps -ef | grep java | grep bgidley | grep -v grep) ] ; then
    if [ -z $TEST ] ; then
    echo “Jetty Not Running so starting”
    cd $JETTY_HOME
    nohup $JAVA_HOME/bin/java $JAVA_OPTS -jar start.jar &
    echo $(ps -ef | grep java | grep bgidley | grep -v grep)
    else
    echo “Running”
    fi

  • Start it and map it into one of your sites in control page.
  • Optionally add the startup script to cron to restart it every 20 minutes if it crashes.

Tapestry 5 vs Struts

Due to my current Job I have finally had the pain pleasure of getting to know Struts. Somehow despite working in Java Web Development for several years I had managed to avoid Struts. First spending several years working with Turbine and then moving Tapestry 4.

Struts always struck me as a bit of a weak framework as it doesn’t really do much. It simply provides a basic form handling and page logic framework. However in many ways this is it greatest strength. Developers who may not ‘get’ the more wizzy frameworks can quickly produce output.

It’s main weakness (as with so much of Java) is the number of choices you can make. I have often heard the argument that Struts developers are easy to recruit - so it is maintainable. The first part of this is true, however the second I have major doubts.

In our app we have tried really hard to keep it simple - yet most of the ’struts’ developers we found hadn’t use the Struts, Spring, Tiles combination we choose. In fact, if I didn’t know better, I would say based on google almost no-one appears to use this combination :). There are (bad) docs for each bit but virtually none explaining how to plug all the bits together.

Now when I then compare this to Tapestry 5 which is really well structured and clean - I can’t help thinking it would be cheaper to train developers on that.

Suse vs Ubuntu

I had heard a lot of good things about Ubuntu - so I decided to move from Suse 10.1 to Ubuntu 7.10 about 5 months ago.

At first I was reasonably impressed. As with any apt based system installations are a breeze. But then as time went by it began to become obvious Suse is miles ahead.

The main missing bits in Ubuntu are

  • A control Panel - Yast lets me changes things after install
  • Not enough working out of the box (e.g. Flash, Java)
  • Robust, after install, hardware detection. On ubuntu I upraded my graphics card and am treated to a page of errors. On Suse it dectects this, recovers and auto-configures my new card.
  • Finsh- Suse is just more professionally finished. From the graphical boot screens, through to centralised configurations it shows they have been doing linux well, longer than pretty much anyone else.

So I switched back to Suse 10.3 yesterday - and it all just works. I was happily developing in IntelliJ within a couple of hours of installing it.

Hiding accounts from the login screen on Vista

In my previous post I had to create a local service account in Vista for Jetty. However I discovered later a side effect - it annoyingly appears on the Vista login screen.

To get rid of it is slightly non-obvious - so

  1. Open a command prompt as administrator
  2. Run mmc
  3. File -> Add Remote Snap In
  4. Add the Local Computer Policy
  5. In Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment. Add the service user to the Deny log on locally policy.

An then magically it disappears. Obvious heh :)

Jetty/Artifactory on Vista

I have been using Artifactory on Windows XP for a while and tried to install it as a service on my Vista PC at home. Artifactory does take a lot of the pain out of dealing with Maven repo’s and I highly recommend using it.

On XP I use the Jetty service wrapper (based on http://wrapper.tanukisoftware.org/) and it all worked perfectly. However on Vista I had a range of odd problems

Firstly Jetty can’t find its temp working folders and then secondly Artifactory complains it can’t open its content repo.

INFO | jvm 1 | 2007/07/14 08:49:05 | Caused by: org.apache.jackrabbit.core.fs.FileSystemException: failed to open output stream to file: /meta/rep.properties
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.getOutputStream(DatabaseFileSystem.java:780)
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.core.fs.BasedFileSystem.getOutputStream(BasedFileSystem.java:135)
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.core.fs.FileSystemResource.getOutputStream(FileSystemResource.java:179)
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.core.RepositoryImpl.storeRepProps(RepositoryImpl.java:1146)
INFO | jvm 1 | 2007/07/14 08:49:05 | ... 40 more
INFO | jvm 1 | 2007/07/14 08:49:05 | Caused by: java.io.IOException: The system cannot find the path specified
INFO | jvm 1 | 2007/07/14 08:49:05 | at java.io.WinNTFileSystem.createFileExclusively(Native Method)
INFO | jvm 1 | 2007/07/14 08:49:05 | at java.io.File.checkAndCreate(Unknown Source)
INFO | jvm 1 | 2007/07/14 08:49:05 | at java.io.File.createTempFile(Unknown Source)
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.util.TransientFileFactory.createTransientFile(TransientFileFactory.java:124)
INFO | jvm 1 | 2007/07/14 08:49:05 | at org.apache.jackrabbit.core.fs.db.DatabaseFileSystem.getOutputStream(DatabaseFileSystem.java:729)
INFO | jvm 1 | 2007/07/14 08:49:05 | ... 43 more

This is caused by file permissions on the Artifactory service. On vista services run under the Local Service account which does have file permissions by default and Jetty doesn’t seem to be able to find a temp dir. So if you create a new account and let jetty run under that it all works.

Changing Jobs

As of next week I will be leaving Macrovision for Ioko. I am going to still be working as a Technical Architect but in a more general role (a bit more like what i did at Anite!).

Working on a product as opposed to being a general technical architect is quite different and although I have enjoyed it, I think I am more suited to working in a more general role. A product based job does let you get to know the good (and bad) bits of the product, but it also limits the range of technologies and roles it is appropriate for you to play. As general TA you must engage will all areas of project, but you also have a lot more responsibility for problems. With a product you can hand-off to the product support team if it doesn’t all work.

I prefer being able to take responsibility and not just passing things off, as I like to see the whole thing working at the end of the day - so I think this move is going to suit me.

Visit a wildlife park

Last weekend we decided to go an visit Cotswold Wildlife Park. My family used to go there when I was a child and thought it would be fun to visit again.

I really enjoyed it. It is still a very nicely laid out place with not too many visitors and what appear to be happy animals. So if you are looking for a day out give it a try.

Safari on Windows (the reality)

OK - yesterday I thought it was cool that Safari was on Windows. Now after only one day of trying to use it I have pretty much had enough. FireFox is simply better!

Why?

  • Memory - Right now FireFox is using 32mb ram - Safari was using nearer 200MB most of the day.
  • Reliability - Safari has crashed and failed on a number of pages. Admittedly with a very nice error reporting dialog for Apple.
  • Bookmarks - The bookmarks feature is so primitive compared to the browser plugin based bookmarks I am used to. I can’t use either Google Bookmarks or del.icio.us with it.
  • Keystrokes - Most of the windows keystrokes for browsers don’t work. I know it is an Apple product but they could play nice with Windows.
  • Tab browsing - Why can’t it open pop-ups in a tab
  • Javascript Features - I have now seen quite a few sites with advanced javascript that just don’t work in Safari. This includes major sites like Facebook and Wordpress (which I use for this blog). I am sure it is probably these sites fault somehow - but it works in IE and Firefox.

It probably isn’t doomed, but there is no good reason for anyone to switch. If they are moving from IE I would say go to Firefox as it just works better out of the box.

Safari on Windows

Apple as ever have decided to change the rules of the game by releasing Safari on Windows. This is quite significant in the browser wars for a couple of reasons

  •  Developers (who often use Windows) will now start testing on IE/Safari rather than IE/Firefox.
  • It should encourage much more cross-platform web design. 
  • It does seem to be quite cool - so even more people will think about trying Apple.

There are some downsides at present. It is a bit buggy (it has had 2 errors since I installed it all of 10 minutes ago) and I am not convinced it is particually quick. I suspect time will tell but this is only going to make IE market share shrink further.