Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

urgent: Jni-C-informix 4gl communication

843829Jun 21 2005
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()
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2005
Added on Jun 21 2005
0 comments
121 views