That message is printed out in the assumption that a null pointer is mainly caused by the situation mentioned in the message. I don't think that this applies here. Just check what the actual exception is (my code should log it afterwards, I don't know what your port does) or at least, in which line is happens. Still, there's something fishy with the way in which is setup things. There should be no need to catch some exceptions that happen during init. It doesn't really help, it just postpones the problem.