Skip to main content

Acucorp-gt interop Java via JNI

  • February 16, 2011
  • 2 replies
  • 0 views

[Migrated content. Thread originally posted on 15 February 2011]

Good afternoon, I'm trying to make calls to the COBOL runtime (wrun32.dll) via Java JNI.
Currently, following the documentation provided, I load the library in my progam with the following code:

try
{
System.loadLibrary("wrun32");
}


The library is loaded whitout any problems and then I create this native methods acording microfocus documentation.


private native int AcuInitialize(Properties properties, String as[]);
public native void Shutdown(String prg);
public native int Call(String prg);
public native int Call50(String prg);
public native void Cancel(String prg);


Up here everything looks fine, but when I run this program calling AcuInitialice method, nothing happens, a Java error appears.

It looks like this...

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.gvsistemas.dataprovider.server.TesterJNI.AcuInitialize(Ljava/util/Properties; [Ljava/lang/String;)I


Well I hope that someone can help me, please!

Regards, Nahuel.

2 replies

[Migrated content. Thread originally posted on 15 February 2011]

Good afternoon, I'm trying to make calls to the COBOL runtime (wrun32.dll) via Java JNI.
Currently, following the documentation provided, I load the library in my progam with the following code:

try
{
System.loadLibrary("wrun32");
}


The library is loaded whitout any problems and then I create this native methods acording microfocus documentation.


private native int AcuInitialize(Properties properties, String as[]);
public native void Shutdown(String prg);
public native int Call(String prg);
public native int Call50(String prg);
public native void Cancel(String prg);


Up here everything looks fine, but when I run this program calling AcuInitialice method, nothing happens, a Java error appears.

It looks like this...

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.gvsistemas.dataprovider.server.TesterJNI.AcuInitialize(Ljava/util/Properties; [Ljava/lang/String;)I


Well I hope that someone can help me, please!

Regards, Nahuel.
Can you post the code you are using to call AcuInitialize?
Please include any code that is used to load the items used in the call.

Thanks,

Paul DuBois

Stephen Hjerpe
  • Participating Frequently
  • February 16, 2011

[Migrated content. Thread originally posted on 15 February 2011]

Good afternoon, I'm trying to make calls to the COBOL runtime (wrun32.dll) via Java JNI.
Currently, following the documentation provided, I load the library in my progam with the following code:

try
{
System.loadLibrary("wrun32");
}


The library is loaded whitout any problems and then I create this native methods acording microfocus documentation.


private native int AcuInitialize(Properties properties, String as[]);
public native void Shutdown(String prg);
public native int Call(String prg);
public native int Call50(String prg);
public native void Cancel(String prg);


Up here everything looks fine, but when I run this program calling AcuInitialice method, nothing happens, a Java error appears.

It looks like this...

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.gvsistemas.dataprovider.server.TesterJNI.AcuInitialize(Ljava/util/Properties; [Ljava/lang/String;)I


Well I hope that someone can help me, please!

Regards, Nahuel.
There is a JavaCallingCobol.java example in the AcuGT\\sample\\java directory. I think you need to use the CVM class that we have made, versus just loading the runtime.

import com.acucorp.acucobolgt.*;