Grails docs go a long way towards being the only materials you need to learn how to use Grails. Unfortunately, it can miss a few things that are common use cases.

In any real world production app, you don’t manage your configuration from within your WAR file. How do you have a configuration file deployed out to your production server beside your WAR file?

Most of the posts out there about external configuration all talk about hard coding external config locations into a variable like so:

grails.config.locations = [ "file:${userHome}/${appName}"]

Well, that sucks. That is assuming, again, more about production then you really can afford. The configuration of the production system, isn’t up to the developer. It’s up to the Release Manager or System Admin or a whole team of people besides you. Rather than force them into accommodating you, the programmer, you need to make it easy for them to specify WHATEVER THE FUCK THEY WANT.
<Read on…>

This is a tip for those of you dealing with long build times, which for me, is anything greater than about 4 seconds 😉

The problem that those of us with NADD face is the second we are waiting for something to finish, we [alt|cmd]+Tab to a browser and start reading slashdot, rotten tomatoes, daringfireball, or any of a million other sites. Likely, you classify this “quick field trip” as multitasking and because you are so very good at multitasking (despite what all the experts say), you disregard the fact that your build was probably finished 10 minutes ago.
<Read on…>

Whew, Grails has some gotchas. It is so great for so many reasons. But WOW! There are some time sinks tucked away for you to discover. In the hope of helping others, here is a list of the ones that hit me.
<Read on…>

I’m embarking, balls-out, on a new project using Grails. I’ll be leveraging a significant portion of our Java codebase and the fact that I can do that,is just plain stellar.

It quickly came time to test out some of the integration. The very first question was how to load resources for testing. E.g., I have a service that handles file uploads. How do I pass it a test file?

The documentation isn’t straightforward on this. In fact, I found the solution attached to a bug report for grails 1.1. It’s pretty simple, once you pull in the spring packages:


And then in your testXXX() function:

Resource resource = new ClassPathResource("resources/crying-baby.jpg")
def file = resource.getFile()
assert file.exists()

And you are good to go. Note the assert at the end to verify things are working.

Just went through a few hours of pounding my head.  I couldn’t, for the life of me, get SOLR to return results sorted by a new date field added to our schema.  My query was simply:

pr_score:[3 TO *] sort pr_lastUpdated desc

No matter what, the results came back sorted by ANYWHICHFRICKINWAY.

Scouring the mailing lists and google search results yielded exactly squat.  Then I found it.  By pure chance I was looking at a developerworks article on IBM and in a table at the bottom the showed this crazy syntax:

<Read on…>

Driving me nuts.

If you are a developer on OS X and you are customer of JetBrains using IDEA the Java IDE, it is a cloudy year for you!

There are two critical bugs that haven’t been fixed in over 6 months since being reported to JetBrains. IDEA enabled my fulltime switch to OS X and now it is unusable after 4 – 5 open files or half a work day. Whichever comes first.

Check it out:

Hidden editor tabs:

CPU spike after every compilation:

Unfortunately, there is no viable workaround.

Come on JetBrains! Fix it!

John Gruber of Daring Fireball fame, who I have mucho respect for, linked to an article about how the Java support in the lastest version of Mac OS X is terrible. He then makes a very irresponsible statement:
“I fail to see why anyone (other than Java developers themselves) would care.”

The problem with this statement is that you should care. Why? Well, because you are a Mac user. It will take a bit to explain. Humor me.

There are many upon many businesses out there that support the Mac platform ONLY because their Java applications will run on a Mac. But this isn’t the complete reason. Hear me out.

Now, these businesses aren’t Google, Microsoft, or IBM. You probably haven’t heard the names of these businesses, let alone the names of the software they provide. They certainly aren’t household names, and your mom and dad aren’t using their applications. But they do represent a significant base of development energy. These are the guys that make it possible for the little guys and the medium guys to do business.

<Read on…>

If you run your own IMAP server or if you use Thunderbird, you may have run into the problem where there are just too many emails in your folder and you need to delete them.

It seems that at a certain threshold of emails, trying to delete your email through any normal IMAP client is just impossible. I first had this happen when I was mail bombed with about 3000 emails. For some reason, Thunderbird just couldn’t handle deleting them. I would select all the messages in my inbox and hit delete. Then it would sit there for hours just spinning.

My first thought was that this was a server problem. To troubleshoot it, I created a groovy script to run through my inbox and delete the messages. It worked and actually finished it in 5 minutes! So it appears there is definitely a problem with Thunderbird and other clients.

<Read on…>

This is pretty cool.


It’s a java API for integrating with Perforce SCM servers. It’s supposed to take the place of P4Package, the Perforce provided API.

I like the fact that its extensible and open source. It’s brought to us by the same people that created

Appearance is everything and I hate it when I have to deal with applications that are designed to sub par standards. A great example of this is the Windows Command Prompt.

I spend quite a bit of time on both Mac and Windows platforms. Unfortunately, of late, the majority has been on Windows. And when I’m stuck on windows, I’m stuck using the command prompt. The command line on Windows is crippled when compared with Linux or OS X. While not as bad as the lack of a fully integrated bash shell, the fact that I’m looking at fonts created in 1991 or earlier really doesn’t make the experience any better.

Unfortunately, the properties window for the command prompt doesn’t give you any choices besides “Raster” or Lucida. There is also no built-in method for adding fonts to this list.

<Read on…>