Running JBoss 4.2.3 on OSX

A simple gotcha, but anyway… If you get an exception like:

java.lang.NoClassDefFoundError: javax/ejb/Stateless
at org.jboss.ejb3.EJB3Util.isStateless(EJB3Util.java:42)

When trying to run jboss 4.2.3 on OSX, it’s because you’re using java 1.5 in stead of 1.6. Follow the instructions here to change.

Updated:…and then of course Eclipse stops working. Here’s how to update.

Share keyboard and mouse between OS X and XP


(It’s more fun when you’re two. Photo by me.)

While I love my Macbook there are still a few programs I need Windows XP to run, especially when you’re doing MIDP development as I happen to be doing at the moment.

So, I had to dust of my old PC and put it beneath my rather small desk. The problem then is that I don’t have room for two keyboards. What to do?

Synergy to the rescue!

Synergy is a program that lets you share mouse and keyboard between two computers using the network. It works really nice, even with simple copy-paste between the OSs.

The installation is not quite as straight forward as one might like so here’s a video showing how to set it up.

Learning a new language


(Photo by me).

I just started reading a book about Cocoa Programming for OS X. (This one). Cocoa uses Objective C, which is somewhat different from C, C++ or Java that I’m more familiar with.

Learning a new programming language is really like entering a new world. You are naked. You don’t know how to solve even the most basic task. It’s a bit scary but also refreshing. You’re being forced to think out of your ordinary little box.

I should do this more often.

Legal email characters regexp

I use GMail for most of my mail. They have a cool feature with which you can add a string to your username part of the email address by ading a +-sign, like this: myusername+astring@gmail.com. Email sent to this address will go to myusername@gmail.com.

This is perfect when you register your email at many sites since you can sort the incoming mail based on the email address given.

The problem is, many email forms have validators that don’t allow +-signs in the email address. I just tried registering at developer.sonyericsson.com but they wouldn’t accept my email.

There’s really no reason for this. There are regular expressions available that do a correct validation. Here’s one example.

JMUnit: simple and good enough

I ended up using JMUnit for my mobile java project. The Sony Ericsson jUnit tool is great when you have to run the tests from a PC on a real device or from a “real” jUnit application. It’s a more advanced tool, but for my needs at the moment, it’s a bit overkill.

So I ended up with what can only be described as the direct opposite: JMUnit is extremey simple. If I change my mind in the future, converting the test cases to jUnit shouldn’t be too difficult.