Highlighted
Absent Member.
Absent Member.
676 views

Managed COBOL access to C functions by setting an entry point to a .dll

I am compiling procedural COBOL into class files and deploying it to an .ear folder which is being run using JBOSS. The program exits prematurely and I am seeing the following error in the server logs:

com.microfocus.cobol.program.COBOLProgramLoadException: 173     Called program file not found in drive/directory [ONOFFCHK]

 

ONOFFCHK is one of many functions the application uses to handle memory contained in a .dll file called ACSDLL. This .dll contains functions exclusively written in C. Using the debugger I have found the line of code where the failure occurs:

SET DLLPTR TO ENTRY "ACSDLL".

 

It seems like the .dll is not being found at runtime, despite its directory being set in the PATH. Is there any particular setup in Eclipse or compiler directives required to link JVM COBOL to a .dll containing C functions?

 

Thanks!

Tags (2)
0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Managed COBOL access to C functions by setting an entry point to a .dll

JBOSS might well prohibit the use of native methods, which would prevent the use of native DLLs from a .ear.

For example ejb's are not allowed to use native methods
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Managed COBOL access to C functions by setting an entry point to a .dll

I am having the same issue even when running JVM COBOL in Eclipse, without being deployed and running it on a server. Where it used to fail on setting the entry point, now it gets past that line with no issues but fails on the line that calls ONOFFCHK itself.

I have added the ACSDLL to the PATH and set it as an environment variable in the project and neither solution has worked. Is it even possible to call specific C functions packaged in a .dll from Visual COBOL? If so, how does one configure the project in Eclipse using Visual COBOL 4.0 to do this?
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Managed COBOL access to C functions by setting an entry point to a .dll

Things, to check:

1) is you DLL the same bitism as the java being used?
2) you may have to setup native library path

help.eclipse.org/.../index.jsp
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.