Posts

Grails, favicon, and urls

I've just spent a little too much time trying to get my favicon working properly on a new grails application. The issue I encountered was due to the fact that I wanted users to be able to access their accounts using '/[username]' - i.e. /paul To accomodate this, I used a UrlMapping: "/$id" { controller='display' action:'index' } Now, this meant that /favicon.ico would hit the controller, and not server the icon file. I first thought I could get around this by constraining the above mapping - so I tried: "/$id" { controller='display' action:'index' constraints { id(notEqual:'favicon.ico') } } It seems though that the only constraint you can use is 'matches'. At least 'notEqual' resulted in a compile error, and all of the examples use 'matches'. So I thought I'd use matches with a regular expression of to exclude the word 'favicon.ico' - turns out that ma...

Firefox 2 on Ubuntu 8.04

I've been a little frustrated with the lack of my usual Firefox plugins due to most of them not being available for Firefox 3, so I've decided to install Firefox 2. It seems apparently easy: sudo apt-get install firefox-2 Now, I can run Firefox 2 from the command line with firefox-2 Firefox 3 still works, by running 'firefox' - so while I can use 3 for browsing, I can use 2 for developing. Note, I had to create a new profile for FireFox 2, because it didn't seem right to run it with the version 3 profiles (and the extensions had a few issues) - but this is fair enough. See Firefox Profiles for more information.

No Dialect mapping for JDBC type: -1

This Hibernate error came at me out of the blue while working on FilmSuggestions.com - I innocently added a constraint to one of my Grails domain models, setting the maxSize of one of the fields to 2000. This changed the table schema making the column type TEXT instead of VARCHAR. The problem came from a native query: sessionFactory.getCurrentSession().createSQLQuery(mostPopularFilmsSQL).list() This selects the TEXT column which results in the error (as described here ). Setting the dialect didn't seem to make any difference, so for now I've changed the constraint so it's back to being a VARCHAR.

Recycling electronic waste - www.thegreenpages.com.au

I've got a couple of old computers and a collection of components that are good for nothing in todays world. But I've had trouble finding somewhere that will take it off my hands and dispose of it in an environmentally friendly way. Imagine my surprise when I saw a google advert on my own blog for  http://www.thegreenpages.com.au/  - a directory of Eco friendly organisations which includes a category on recycling. Hopefully it won't be long before I can clean out some of the rubbish.

Rhythmbox

I've just been playing with RhythmBox for the first time, and am very pleasantly surprised. This application so far takes care of my music and podcast requirements, and also supports the iTunes links you see on so many sites. You can either copy the iTunes link and add it manually, or in FireFox, clicking on the link pops up a dialog asking what application should be used - specifying /usr/bin/rhythmbox achieves the desired result, and the podcast is added just like that. Rhythmbox also supports my wifes ipod, which is great for managing that. Although I don't use internet radio, I'd like to and it takes care of that too. I've still got more to play with, but so far I'm happy and will be sticking with it for the foreseeable future. (Ubuntu 8.04Beta, Linux Dell Inspiron 1525 Laptop, 2.6.24-16-generic #1 SMP Thu Apr 10 13:23:42 UTC 2008 i686 GNU/Linux)

Wordpress error - Allowed memory size of ## bytes exhausted

I just came across a problem using wordpress that stopped everything working - any request to the Wordpress site resulted in a blank page. In the log file for the host, I could see: PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 14592 bytes) in <path to a plugin php file> Removing the plugin specified just meant that the error was reported for the next plugin. Searching Google showed many discussions about this problem. Luckily the solution for me was easy enough - as described in this topic : In <wordpress root>/wp-includes/cache.php I just added: ini_set("memory_limit","12M");

grails-selenium-0.4

This information is out of date - please see http://www.grails.org/Selenium+plugin Version 0.4 of the grails selenium plugin is now available. This version adds: scripts to create and run tests a postResults url for displaying the final test results Details are as follows: run-selenium Runs Selenium in the specified browser. Specify the path to your browser as a command line parameter i.e. grails run-selenium /usr/bin/firefox or, if the executable is on the path you would just need grails run-selenium firefox In your application.properties, you can specify: selenium.auto=true selenium.close=true selenium.multiWindow=true selenium.highlight=true selenium.resultsUrl=/your/url/here (defaults to ${appContext}/selenium/postResults) selenium.runInterval=1000 selenium.baseUrl= See http://selenium.openqa.org/installing.html (section titled Continuous Integration) for more information on selenium and continuous integration. create-selenium-test Generates a new empty selenium test. Supply th...