Question

I have a Lotus Notes Agent written in Java which should pop up a message to the user after it is executed by clicking a button in the Notes client. Trying to display the pop-up causes an error which I see in the Java Debug console as :

java.security.AccessControlException: Access denied (java.lang.RuntimePermission exitVM.0)
at java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at COM.ibm.JEmpower.applet.AppletSecurity.superDotCheckPermission(AppletSecurity.java:1449)
at COM.ibm.JEmpower.applet.AppletSecurity.checkRuntimePermission(AppletSecurity.java:1311)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1611)
at COM.ibm.JEmpower.applet.AppletSecurity.checkPermission(AppletSecurity.java:1464)
at java.lang.SecurityManager.checkExit(SecurityManager.java:756)
at java.lang.Runtime.exit(Runtime.java:99)
at java.lang.System.exit(System.java:279)
at ClipboardTest.main(Unknown Source)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)

My agent code is

    import lotus.domino.*;
    import javax.swing.JOptionPane; 

    public class JavaAgent extends AgentBase {

public void NotesMain() {

  try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here)
      Document cdoc = agentContext.getDocumentContext();
      String[] notesURL = new String[] {cdoc.getNotesURL()};
      ClipboardTest.main(notesURL);
      JOptionPane.showMessageDialog(null,"message","title",JOptionPane.WARNING_MESSAGE);

  } catch(Exception e) {
      e.printStackTrace();
   }

} }

I have manager access to the Database. What could be causing this error?

Was it helpful?

Solution

First look at what the error actually is:

 Access denied (java.lang.RuntimePermission exitVM.0)

You are telling the VM to die and you do not have the rights to do this. If you had, you would cause anything else running on that JVM instance to die as well, possibly leading to a hang/crash.

Secondly your code is failing in the ClipboardTest.main() method, which you haven't posted any code for.

In the agent properties there is an option to add debug data. This will give you the exact line number that is causing the issue.

My guess is you have a System.exit() call in the ClipboardTest.main() . It shouldn't be there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top