× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This seems to be a Java classpath issue but rather than post to the JAVA400 list, I am posting here because the calls originate in RPG-land....

I am updating some code that was working in 7.3 (and all the way back to 5.2) and that I haven't touched or tested since I updated to a P9 and 7.4.  The only thing I updated were the jars referenced on the Java side of things.  I did recompile all the RPG code to make sure it was compatible back to 7.2  Debugging this code has always been a hassle and I have had little luck in using the standard STRSRVJOB/STRDBG steps from the command line. When I take that approach and add the class when the breakpoint is hit in RPG, everything hangs...forever.  Never get a time out or a failure I just see "SYSTEM" waiting in both sessions and never go any further.  No messages on the jobs.

If I just run the program without debugging, I get the classic:

Java Virtual Machine is IBM Technology for Java.  PID(4135)
JVM properties were loaded from a properties file.
Java exception received when calling Java method.
Application error.  RNX0301 unmonitored by .....

The Java exception has this tidbit:

 Cause . . . . . :   RPG procedure ...... received Java
   exception "java.lang.NoClassDefFoundError:
   org.apache.commons.logging.LogFactory" when calling method

The classpath DOES have the class org.apache.commons.logging.LogFactory in the jar in the classpath so I suspect that something else is going on.  The CL program sets the CLASSPATH environment variable before calling the RPG program.  The classes were built in using 1.8 of Java in Windows (Open J9 - OpenJDK 1.8.0_192) and jarred and made available in the IFS.  I can run the java programs when I call them in PASE (BASH shell) and I can run them in qp2term so I don't think it is an issue with the Java version (java version "1.8.0_281").  I use the same classpath in the CL that I use in PASE and QP2TERM.  But, it seems that the classes aren't loading correctly when called from CL/RPG...?

So, two things:

1)    Can you think of anything that maybe I should have set up in 7.4 (new install, not a migration) that might affect the JNI calls differently than the PASE/QP2TERM calls?

2)    Is there a better way to debug these JNI calls?  I use RDI but haven't really used any debugging tools in RDI since most of my development work is in Java on Windows.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.