I’ve got a web agent that runs in lotusscript but it needs to call a java method via LS2J. The purpose is to print out some content and I need access to the printwriter for that. The docmentation points me to using getAgentOutput()
however this throws a null pointer exception. The class is structured as follows:
import java.io.PrintWriter;
import lotus.domino.*;
public class WebPrinter extends AgentBase {
public boolean printFile(String fileName) {
try {
PrintWriter pw = getAgentOutput(); <--- error here
...
} catch(Exception e) {
...
}
}
The lotusscript that calls it is as follows:
Use "JavaWebCode"
Dim jSession As New JavaSession
Dim jClass As JavaClass
Dim jObject As JavaObject
Set jClass = jSession.Getclass("com.test.WebPrinter")
Set jObject = jClass.Createobject()
result = jObject.printFile(fileName)
...
The error is:
java.lang.NullPointerException at
lotus.domino.AgentBase.getAgentOutput (unknown source)
How to I get access to the PrintWriter outside a Java agent? I don’t really want to refactor the lotusscript agent to Java if I can.
Thanks all.