Thanks for the reply Barbara. So, there is an RPGLE call that invokes
a "wrapper" Java method that basically invokes the JasperReports API to
generate a "pretty" report from a Jasper Reports template. Originally,
I had combined most of the jars into a "one jar to rule them all" jar
that again, worked fine in PASE. Not knowing if the class not found
error had something to do with the way I created the "super jar" (even
though it worked in Windows and PASE) I resorted to setting an
environment variable that lists all 29 jars instead. The error is
different now. And, yeah, I tripped across a couple of articles that
suggested setting up tracing out to a file. So, here is what I get now:
Message ID . . . . . . : RNX0301
Date sent . . . . . . : 07/20/21 Time sent . . . . . . :
14:22:32
Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure RRE_IPRINT in program RRE/RRE received
Java
exception "java.lang.ExceptionInInitializerError:" when calling method
"iPrintCompiledReport" with signature
"(Ljava.lang.String;Ljava.lang.String;Ljava.util.HashMap;Ljava.lang.String;)
Z" in class "com.valadd.report.engine.Generator".
And the output file for the trace has:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.ensureError(J9VMInternals.java:146)
at
java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:135)
at
net.sf.jasperreports.engine.DefaultJasperReportsContext.getExtensions(DefaultJasperReportsContext.java:277)
at
net.sf.jasperreports.engine.util.MessageUtil.getMessageProvider(MessageUtil.java:70)
at
net.sf.jasperreports.engine.JRException.resolveMessage(JRException.java:167)
at
net.sf.jasperreports.engine.JRException.getMessage(JRException.java:148)
at
net.sf.jasperreports.engine.JRException.getMessage(JRException.java:139)
at java.lang.Throwable.getLocalizedMessage(Throwable.java:207)
at java.lang.Throwable.toString(Throwable.java:356)
at java.lang.Throwable.printStackTrace(Throwable.java:546)
at java.lang.Throwable.printStackTraceHelper(Throwable.java:338)
at java.lang.Throwable.printStackTrace(Throwable.java:307)
at java.lang.Throwable.printStackTrace(Throwable.java:250)
at
com.valadd.report.engine.Generator.returnReportPrint(Generator.java:571)
at com.valadd.report.engine.Generator.printReport(Generator.java:384)
at
com.valadd.report.engine.Generator.iPrintCompiledReport(Generator.java:314)
Caused by: java/lang/ExceptionInInitializerError
at java/lang/J9VMInternals.ensureError (J9VMInternals.java:146)
at java/lang/J9VMInternals.recordInitializationFailure
(J9VMInternals.java:135)
at
net/sf/jasperreports/engine/DefaultJasperReportsContext.getExtensions
(DefaultJasperReportsContext.java:277)
at net/sf/jasperreports/engine/util/MessageUtil.getMessageProvider
(MessageUtil.java:70)
at net/sf/jasperreports/engine/JRException.resolveMessage
(JRException.java:167)
at net/sf/jasperreports/engine/JRException.getMessage
(JRException.java:148)
at net/sf/jasperreports/engine/JRException.getMessage
(JRException.java:139)
at java/lang/Throwable.getLocalizedMessage (Throwable.java:207)
at java/lang/Throwable.toString (Throwable.java:356)
at java/lang/Throwable.printStackTrace (Throwable.java:546)
at java/lang/Throwable.printStackTraceHelper (Throwable.java:338)
at java/lang/Throwable.printStackTrace (Throwable.java:307)
at java/lang/Throwable.printStackTrace (Throwable.java:250)
at com/valadd/report/engine/Generator.returnReportPrint
(Generator.java:571)
at com/valadd/report/engine/Generator.printReport (Generator.java:384)
at com/valadd/report/engine/Generator.iPrintCompiledReport
(Generator.java:314)
net/sf/jasperreports/engine/JRRuntimeException: util.class.instance.error
at net/sf/jasperreports/engine/util/ClassUtils.instantiateClass
(ClassUtils.java:81)
at
net/sf/jasperreports/extensions/ExtensionsEnvironment.createDefaultRegistry
(ExtensionsEnvironment.java:91)
at net/sf/jasperreports/extensions/ExtensionsEnvironment.<clinit>
(ExtensionsEnvironment.java:78)
at
net/sf/jasperreports/engine/DefaultJasperReportsContext.getExtensions
(DefaultJasperReportsContext.java:277)
at net/sf/jasperreports/engine/util/MessageUtil.getMessageProvider
(MessageUtil.java:70)
at net/sf/jasperreports/engine/JRException.resolveMessage
(JRException.java:167)
at net/sf/jasperreports/engine/JRException.getMessage
(JRException.java:148)
at net/sf/jasperreports/engine/JRException.getMessage
(JRException.java:139)
at java/lang/Throwable.getLocalizedMessage (Throwable.java:207)
at java/lang/Throwable.toString (Throwable.java:356)
at java/lang/Throwable.printStackTrace (Throwable.java:546)
at java/lang/Throwable.printStackTraceHelper (Throwable.java:338)
at java/lang/Throwable.printStackTrace (Throwable.java:307)
at java/lang/Throwable.printStackTrace (Throwable.java:250)
at com/valadd/report/engine/Generator.returnReportPrint
(Generator.java:571)
at com/valadd/report/engine/Generator.printReport (Generator.java:384)
at com/valadd/report/engine/Generator.iPrintCompiledReport
(Generator.java:314)
So, I am walking the stack trace now to figure out what the issue
*might* be. Seems to be related to actually throwing the exception and
printing the stack trace, but I can't be sure. I am going to try to add
some more output when the error occurs and see if I can sort out the
issue. Might be environmental...just guessing at this point....
Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
AWS Certified Cloud Practitioner
Microsoft Certified: Azure Fundamentals
Twitter - Sys_i_Geek IBM_i_Geek
On 7/20/2021 1:46 PM, Barbara Morris wrote:
On 2021-07-19 4:11 p.m., Pete Helgren wrote:
...
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
...
Is org.apache.commons.logging.LogFactory also the method being dalled
directly from RPG? (The method mentioned in the RNX0301 message
following "when calling method")
If you were calling some other method, then the NoClassDefFoundError
would have been received after the called Java method started. In that
case, it might be useful to get an exception trace from Java. If you
add this envvar, you'll get an exception trace printed to stderr.
ADDENVVAR QIBM_RPG_EXCP_TRACE value('Y')
Here's the RPG/Java troubleshooter in the RPG Cafe:
https://www.ibm.com/support/pages/node/1117695
As an Amazon Associate we earn from qualifying purchases.