Sorry, being an idiot. You might want to look at Domino Designer help with regards additional classes accessing Domino objects. Specifically, look at the NotesThread class (which AgentBase extends, and therefore is also the superclass of your Java agent):
"Each thread of an application making local calls must initialize a NotesThread object. This includes AWT threads that access the Domino Objects. Listener threads must use the static methods because they cannot inherit from NotesThread."
HTH
--
http://www.benpoole.com