import lotus.domino.*; import java.net.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // Get the document with the parameter Agent agent = agentContext.getCurrentAgent(); Database db = agentContext.getCurrentDatabase(); Document doc =db.getDocumentByID(agent.getParameterDocID()); // write IP to the document InetAddress inet = InetAddress.getByName( doc.getItemValueString("hostname") ); doc.replaceItemValue("IP",inet.getHostAddress() ); doc.save(true, false, true); } catch(Exception e) { e.printStackTrace(); } } }
29.09.2005 09:09:31 Agent error: java.lang.NullPointerException29.09.2005 09:09:31 Agent error: at JavaAgent.NotesMain(JavaAgent.java:19)29.09.2005 09:09:31 Agent error: at lotus.domino.AgentBase.runNotes(Unknown Source)29.09.2005 09:09:31 Agent error: at lotus.domino.NotesThread.run(NotesThread.java:218)