LS2J newbie: Unable to run load javaclass in LS agent

Hi all,i need a helping hand on getting the my lotus script agent call java classes.

What i have done already:

  • add JavaUserClasses=javapath into the notes.ini

  • add the Uselsx statement

  • add the follwing to my agent

    Dim mySession As JavaSession

    Dim myClass As JavaClass

    Dim fm As JavaObject

    Dim ret As Integer

    Set jSession = New JavaSession()

    Set jClass = mySession.GetClass(“filemanager”)

    Set fm = jClass.CreateObject()

  • have created my filemanager.class

And if i ran the agent i got ClassNotFoundException.

I tried to run the agent on a shared database on on a local one with the same results.

What i am doing wrong?

Need the javaclass to be in a JAR file?

Please help.

Subject: LS2J newbie: Unable to run load javaclass in LS agent

Does your ClassPath look like this (or something close to it) JavaUserClasses=c:/java/db2_classes.jar;c:/java/jt400.zip

The java files must be stored on your PC if you are the one triggering the Agent

if it is a scheduled agent then the server needs to store the java files

'in your Options

Uselsx “*javacon”

Use “getDeliveryRecords” 'Name of the Java library that you are using

'in your Declarations

Dim gPInfo As JAVACLASS

Dim chObject1 As JavaObject

'in your Initialize

Dim s As New NotesSession

Set jSession = New JavaSession()

Set gPInfo = jSession.GetClass(“retrievePatientRecords”) ’ Name of the java class that you are calling

Set chObject1 = gPInfo.CreateObject(“()V”)

'calling the Java code from in your agent

returnInsert = chObject1.getOrderInfo(strLogin, strPassword, strOrderNo)

'getOrderInfo is the java method that you are calling

Also remember, any change you make to the java code your must restart Notes

and

the first 2 or 3 times that you start using Java in this manner it might not work, not sure why, this is what I was told when I started working on LS2J

if you need more help, feel free to e-mail me

mdm@electricmobility.com