We have code written in Java but would like to call this from within an agent. We can include the base NSF as part of the build but this does not get retained and the agent will not properly run.
Is it possible to include your Java code within an agent? If so, how is it best to implement this?
What kind of Java is it ?
Class files/Java source files or Jars ?
If you want to have it available in an agent you can import Java/Jar files into a ScriptLibrary type Java.
Or if it is a Jar file you can also deploy it to server or clients to JVM\lib\ext directory or using JavaUserClasses Notes.ini directory to point to another directory.
It depends on your use case what is the best way and which implications it has.
Because Java permissions can be a difficult thing inside an Agent
Java class/source files ( found in the Java segment under Code in Designer ). They are referenced in XPages but at times there are procedures that need to be run on a schedule which is why the agent is being created for this purpose. There are also times we need to run some procedures by calling the agent and passing a document in ( parameters ).
For agents best would be then to put it into a ScriptLibrary
So basically you can't re-use the code? I also tried creating classes in the agent / script library but it seems to lose the domino classes ( import does not work ) unless it's part of the default class?
What error message did you get traying to import and how you import domino classes ?
You can also import your java files instead of creating them there
FWIW, you can even use Java code from a LotusScript agent; see Designer Help for details (search for "LS2J"). Not sure though if this is what you are looking for.