Call it my friends bad luck or your good luck(hopefully) :). He had
exactly the same problem that you were facing.
The problem turned out to be the constructor definition that he had given
was wrong. The parameters were all wrong. In his case this was the reason
why the exception was thrown. Just check if you have a similar problem.