urgent: Jni-C-informix 4gl communication
We are working on a project to take the compiled version of Informix 4GL and
integrate it with our Java applications. I will stay away from why, just trying
to figure out how.
We are using JNI to call C program which will in turn call informix 4gl. We are able to call C function but this function throws some critical errors when tries to call informix 4gl function.
Following is the output we are getting when trying to run java program. Souce code used in this application is also given below.
output:
stackpointer=2ff20b00
JVMXM004: JVM is performing abort shutdown sequence
JVMDG217: Dump Handler is Processing a Signal - Please Wait.
JVMDG303: JVM Requesting Java core file
JVMDG304: Java core file written to /home/smisra/test/vijayjni/javacore1433600.1119335277.txt
JVMDG215: Dump Handler has Processed Exception Signal 4.
Illegal instruction
Source Code:
TestingImpl.c
#include <jni.h>
#include "Testing.h"
#include <stdio.h>
#include "/opt/informix/prod/incl/tools/fglsys.h"
#include "/opt/informix/prod/incl/tools/fglapi.h"
JNIEXPORT void JNICALL Java_Testing_simple
(JNIEnv *env, jobject obj){
call_1(); /* calling call_1() function of p3.c which will call 4gl function*/
}
p3.c
#include<stdio.h>
#include<fglapi.h>
#include "/opt/informix/prod/incl/tools/fglsys.h"
void call_1()
{
fgl_start("informix_func");
fgl_call(informix_func,0); /*calling 4gl function (informix_func()) present in prog_3.4gl */
}
prog_3.4gl
function informix_func()
display "checking"
end function
Testing.java
public class Testing
{
public native void simple();
static {
System.loadLibrary("TestJni");
}
public static void main(String[] args)
{
new Testing().simple(); //calling native function simple()
}
}