Compiling and running LANSA Integrator's Remote Function Invocation example

Date:Archived
Product/Release:LANSA Integrator EPC634 or later
Abstract:Some guidelines for compiling and running the shipped LANSA Integrator's Remote Function Invocation example.
Submitted By:LANSA Technical Support

From EPC634, LANSA Integrator includes a Remote Function Invocation (RFI) example. This example shows how Java applications can be integrated with LANSA Functions, using LANSA Integrator. The sample Java program sends and receives objects using several classes (RFIDataSource, RFIDataTable, RFIService, implemented in the shipped jsmrfi.jar file). The example sends a "request" object and receives a "response" object.

You can also refer to the LANSA Integrator's and Java's documentation for more details.

Following are a couple of considerations when compiling and running the RFI example or any similar Java program.

When you compile a Java program, the referred classes are, by default, resolved from the <java development environment home>\jre\lib\ext directory. To find out what your <java development environment home> is, go into the Registry and look for value HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion. Then go to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\<CurrentVersion value>\JavaHome to see what your <java development environment> directory is. You have to copy file: jsmrfi.jar (copied to the Java Runtime environment when installing LANSA Integrator) to the <java development environment home>\jre\lib\ext directory. From a Command window, you can compile the example using batch file c.bat, included in the RFI directory.

If the jsmrfi.jar file is not in that directory, you would get compilation errors stating that some classes could not be resolved (e.g. RFIDataSource, RFIDataTable, RFIService).

When you execute a Java program, the referred classes are, by default, loaded from the <java runtime environment home>\lib\ext directory. To find out what your <java runtime environment home> is, go into the Registry and look for value HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion. Then go to HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\<CurrentVersion value>\JavaHome to see what your <java runtime environment home> directory is. Then , ensure that file jsmrfi.jar exists under the specified directory (...\lib\ext) If the file is not there, you may need to ensure that the LANSA Integrator's RFI was installed correctly. 

You can execute the example, from a Command window, using batch file r.bat, included in the RFI directory.