Not that this relates to your problem, but have you tried SDK 1.2?
With Java, symptoms like getting a null pointer exception after some number of seconds is typically due to the controller or listener object getting garbage-collected. You need to retain a reference to those objects in a class member so that they stick around.
It's unfortunately not so obvious to do this when looking at Sample.java. That sample program is modeled after our Sample.cpp and blocks on a readline(), which doesn't match the structure of most real-world Java programs.