I would like to ask a question about using Java classes in SSJS (Server Side JavaScript) on xPages. I created a simple Java class "HelloWorld" and exported it to a jar file. Then I tried to call it from SSJS on an xPage but with no success. These are some things that I tried:
- Added the jar to the build path of the .nsf (both jar and nsf were local)
- Added the jar to WEB_INF/lib folder of the nsf.
Called the class of the jar directly from SSJS as
var a = new com.myself.testJava.HelloWorld();
Called the class from another Java class that I created in the nsf and then call the second class from SSJS.
I always get an error 500 "HTTP Web Server: Command Not Handled Exception"
I have also tried to run my xpage on a server and add the jar file to the jvm/lib/ext folder. In this case the error was "com" not found, which I understand that it means that the class cannot be found.
I have accomplished to create a java class in the nsf and then call from SSJS, but I want to be able to use 3rd party classes.
Could you please give any information about what are the correct steps?
Thanks a lot in advance!