Highlighted
Absent Member.
Absent Member.
1469 views

C$JAVA issue CJAVA-CLASSNOTFOUND

Jump to solution

I am facing an issue while using the sample Acucobol program to call Java from cobol. I have small piece of code in my cobol program as :

CALL "C$JAVA" USING CJAVA-CALLSTATIC "C:\Javaprojects\TestCobol2Java\bin\CobolCallingJava", "CobolCallingJavaInt", "(I)I", FIELD-INT, FIELD-RET GIVING STATUS-VAL

it returns status-val as "-3" which seems classnot found

I have tried with both with or without pathing but it results same. Java program cobolcallingjava.class reside at C:\Javaprojects\TestCobol2Java\bin and cobolcallingjava.acu reside at c:\maint\object. I am using Acubench 720 where I could not find the config file. so I modified the cblconfig file as per instructions file. Where do I need to place the config file and keep cobol & java code.? I suspect issue is with different locations. Appreciate your help!

Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA issue CJAVA-CLASSNOTFOUND

Jump to solution

I would try a simple setup, place the Java class, your config file and acu object in the 720/bin directory. You could then execute bin/wrun32 -c config  cobolcallingjava

View solution in original post

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA issue CJAVA-CLASSNOTFOUND

Jump to solution

I would try a simple setup, place the Java class, your config file and acu object in the 720/bin directory. You could then execute bin/wrun32 -c config  cobolcallingjava

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA issue CJAVA-CLASSNOTFOUND

Jump to solution

Okay, now that you have it working in the bin directory, expand your setup. Place the acu object, java class and config file in c:\maint\object. In the config file have CODE_PREFIX c:\maint\object

now execute wrun32 -c c:\maint\object\config cobolcallingjava.acu

Better still execute wrun32 -c c:\maint\object\config -dle xxx cobolcallingjava.acu

where -d starts the debugger - just enter g to go. The xxx file will have lots of entries where the runtime is looking for code. This will be helpful when deploying on linux. Having the environment settings correct is half the battle.

Thin client is for the COBOL UI ( user interface) to land on the desktop. The code (object) executes on the server (linux in your case). You'll need a Linux Java runtime (jre) for the Java classes. So experiment, if you have AcuConnect running on a linux server then you have acu objects and config files that you currently use. You would pattern this COBOL-Java program in a similar way. place the acu objects and Java classes in a directory, create your config file, set up your alias and then execute thin-client server alias. If you don't have Thin client running, start with the simple setup again. Place the acu objects and Java classes and config file in the 720/bin directory on linux. Go through the process of creating an AcuConnect Access file, an AcuConnect alias file, starting AcuConnect and then trying acuthin from the client.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: C$JAVA issue CJAVA-CLASSNOTFOUND

Jump to solution

It occurred to me that cobolcallingjava.acu has no display statement so you can use it on Windows  or Unix/Linux or through Thin client.  Take the object and class and place them on linux in your 720/bin and use: runcbl cobolcallingjava.acu  .. or .. runcbl -c config cobolcallingjava.acu

Now set up AcuConnect Access file, an AcuConnect alias file, starting AcuConnect and then trying acuthin

from your PC .. acuthin linux-server-name:port -d alias-name

using the -d on acuthin will invoke the debugger (as the object has no display syntax)

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.