The code shows that it also does a printStackTrace() in the catch block.
The problem would be shown in that stack trace message. What was the full contents of the java console?