Highlighted
Absent Member.
Absent Member.
1159 views

Debug JVM Cobol remote application - Wait for Application Attachment

Hi,

we have a Cobol JVM application on an AIX. The Cobol JVM classes are called by a Java main file. The java main itself is called by cobjrun with a korn shell script. What we want to do now, is the debug the Java and the JVM cobol file in Eclipse. So we need a debug function for JVM Cobol like "COBOL Wait for Application Attachment". Or is it possible to use the debug configuration "COBOL JVM remote Application" for this issue? We were not able to make it work with this function.

 

Thanks and best regards

Paul

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Debug JVM Cobol remote application - Wait for Application Attachment

Hello Paul,

I'm checking into whether what you are trying to do is possible. Perhaps you can provide a little background information that may help:

1) Is the COBOL JVM code you have being built using a Remote COBOL Project in Eclipse, or at the command line?

2) You've mentioned that this is on AIX - what version of AIX are you on?

3) Which JDK and version is being used?

4) Finally, what version of Visual COBOL Development Hub (on AIX) and Eclipse IDE (on Windows) are you using?

Blair McDonald

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Debug JVM Cobol remote application - Wait for Application Attachment

Hi Blair,

1) The COBOL JVM code is builds on AIX with command line.
2) We are using AIX 7.1
3) >java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build pap6470_27sr4fp15-20171116_01(SR4 FP15))
IBM J9 VM (build 2.7, JRE 1.7.0 AIX ppc64-64 Compressed References 20171011_366929 (JIT enabled, AOT enabled)
J9VM - R27_Java727_SR4_20171011_1720_B366929
JIT - tr.r13.java_20171011_366929
GC - R27_Java727_SR4_20171011_1720_B366929_CMPRSS
J9CL - 20171011_366929)
JCL - 20171109_01 based on Oracle jdk7u161-b13

4) On AIX: Micro Focus Visual COBOL Development Hub 3.0 - Patch Update 06
On Windows: COBOL for Eclipse IDE Version: 3.0.478.v201706141050

Thanks and best regards
Paul
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Debug JVM Cobol remote application - Wait for Application Attachment

Hi Paul,

Thank you for your updates. You should be able to use cobjrun with some special options to achieve the effect you want.

Before you run the ksh script, start a "Remote Java Application" debug session in Eclipse using the “Standard (Socket Listen)” option - this puts the debugger into a wait state. Then in the ksh script, use the “server=n” option when invoking cobjrun. Here's an example:

cobjrun -agentlib:jdwp=transport=dt_socket,server=n,address=debuggermachine:8000,suspend=y <classname>

The server=n makes the invoked Java class connect to the debugger you've already started.

As an alternative to the above, you could use suspend=n, and just set a breakpoint in the places you want to stop.

Finally, I noticed that you are running Patch Update 6 of Visual COBOL Development Hub 3.0, but the base version of Visual COBOL for Eclipse 3.0 on Windows. We recommend that you keep the versions of the two products in sync, so that any fix that might require changes to both products will work as expected. For products with an active maintenance agreement, you can obtain Patch Updates from the supportline.microfocus.com website, using the Product Updates link.

Blair McDonald

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.