NullPointerException thrown from Service.doInvoke

I am using IS4.6 and trying to call Service.doInvoke from some custom java code. I believe the issue could be that the code creates a thread and then invokes the Service.doInvoke. Any suggestions would be greatly appreciated.

Joe