I'm writing a Java (not Javascript) script library (not agent) in Code -> Script Libraries and would like to run this script from action button. Actually it works but I need to debug my Java code to complete my task. All manuals which I found in internet are regarding debugging of Java agents, not sure is it same setup or not for script libraries. Thank you.
Asked
Active
Viewed 426 times
1
-
Notes 9 has an integrated JavaScript debugger but is related to XPages development (SSJS). – Knut Herrmann Feb 09 '14 at 08:46
-
Sorry, I mislead you but I mean script library on Java, not Java script, and I use Lotus Notes 8.5 – Anatoly Feb 09 '14 at 09:20
-
How do you use your Java library? In an XPages button or LotusScript button with LS2J? So far we know only it's not an agent... – Knut Herrmann Feb 09 '14 at 17:16
-
I use LotusScript button with LS2J. @KnutHerrmann I haven't worked with XPages therefor I didn't know that I can work with it too. – Anatoly Feb 09 '14 at 17:44
1 Answers
3
There is no build-in debugger for debugging Java code called from LS2J.
You can include System.out.println() lines in your Java code and will see the output on server's console or on the client's Java console depending where code is running.
I suggest to create tests for your Java code with e.g. jUnit in Eclipse. There you can debug your code until it's running like expected and only then to use it from LS2J.
Be aware of some issues with LS2J. You can't use Java file resources for instance.

Knut Herrmann
- 30,880
- 4
- 31
- 67
-
Thank you! @KnutHerrmann , do you know is it possible to get Notes Session when I create script library in Java? I need to export view to ODS (Open Office) and need to get View which I get get only from session. Actually I succeeded to perform this task by agent, but want to know is it possible to do the same only by script library? Thank you in advance. – Anatoly Feb 11 '14 at 08:58
-
1@Anatoly: If you really want to stay with LS2J and not just call a Java agent then I would read view data in LotusScript and deliver all data for ODS output to Java object by a method "addData()". This way you can test your Java class independent from Notes data and don't need a Notes Session object. – Knut Herrmann Feb 11 '14 at 09:18
-
thank you for your advice. I'd like to make solution generic as much as possible and at the end decided to do it with agent. In this way all the code is stored inside the agent, I only need to pass to it name of the view by usin SetEnvironmentVar. – Anatoly Feb 11 '14 at 11:13