我有这些文件:https://github.com/OpenNTF/org.openntf.domino 我在lotus domino设计师中创建了一个java代理。 我将jar:org.openntf.domino添加到java代理。
这是java代理中的代码:
import org.openntf.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
System.out.println("test");
// (Your code goes here)
} catch(Exception e) {
e.printStackTrace();
}
}
}
然后运行它,然后我收到此错误:
java.lang.IllegalStateException: org.openntf.domino.utils.Factory is not initialized for this thread!
at org.openntf.domino.utils.Factory.getThreadVariables(Factory.java:345)
at org.openntf.domino.utils.Factory.getWrapperFactory(Factory.java:627)
at org.openntf.domino.AgentBase.getSession(AgentBase.java:25)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Factory.getSession(); does not work
我在这里做错了什么?