1

here is my code when I trigger it it shows an error

Dim jSession As New JavaSession
Dim jClass As JavaClass
Dim jObject As JavaObject
Set jClass = jSession.Getclass("learn/MyClass")
Set jObject = jClass.CreateObject
Call jObject.myMethod() 

The error is : Ls2j error : Threw java.lang class not found exeption I have tried everything which I found on internet but error is still there with package name without package name class path or loaction but somehow its not finding the class kindly help me out of this.

thats the image of error

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67

1 Answers1

0

Put your Java class(es) into a ScriptLibrary of type Java

strong text

and refer to it with

Use "MyJavaLib" 

in your LotusScript code.

Unfortunately, you can't just put Java classes into nsf's folder "Code/Java". This folder is reserved for XPages application development only.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • hi Hermann I have a problem whenever am trying to refer my library (Use "MyLib") it crashes my apllication with a notification error .. It worked for me but now m getting this error when i remove use "MyLib" application works fine – Muhammad Saleh Apr 30 '20 at 06:22
  • Sign the database and try it again, please. – Knut Herrmann Apr 30 '20 at 11:10
  • Another possibility is that your Java code throws an Exception. Try to start with a simple Java code and add your original code one by one later. – Knut Herrmann Apr 30 '20 at 11:18
  • thanks it is resolved..please look at this question https://stackoverflow.com/questions/61519697/how-to-access-current-logged-in-user-email-address-in-lotus-script/61521324#61521324 – Muhammad Saleh Apr 30 '20 at 11:26
  • Oh, I see. You tried to use Domino classes in LS2J. This is not possible. – Knut Herrmann Apr 30 '20 at 12:03