I am passing parameters to a Java agent from Lotus Script like this:
Set db = session.CurrentDatabase Set doc = db.CreateDocument Set uiDoc = workspace.
You have to save the doc in your Java code and to re-read your doc in LotusScript after calling your agent.
It is easier to use an In-Memory Document though:
LotusScript
MyAgent.RunWithDocumentContext(doc, doc.NoteID)
Java
Document doc = agentContext.getDocumentContext()