ai Everybody,
I need to call a set of PERL modules from a J2EE application server using java classes (probably using
JNI).
Is it possible ? (Does J2EE allow JNI ?).
If so which Application Servers allow this ?
If i cant use JNI, what are the alternatives ?
Thanks in advance.
Anne
-
JNI and J2EE (1 messages)
- Posted by: Anne Srinivas
- Posted on: October 23 2001 11:55 EDT
Threaded Messages (1)
- JNI and J2EE by dave t on October 23 2001 12:18 EDT
-
JNI and J2EE[ Go to top ]
- Posted by: dave t
- Posted on: October 23 2001 12:18 EDT
- in response to Anne Srinivas
Two alternatives:
1. Use the java.lang.Runtime class with the exec() method. Call the perl script and read the output. The problem here is that you might block and the format of the call is system dependant.
2. Modify your perl application to be a server. You could use XML-RPC, SOAP, HTTP, etc ... Then write java code to call the server.
I've used (2) in the past with XML-RPC to have Java and VB clients call my perl. I ran the perl program in Apache using mod_perl. This works well if you allready have an Apache instance. Otherwise, I believe that the Perl XML-RPC module has the ability to create a simple server for you.
-Dave