daust / JasperReportsIntegration

JasperReportsIntegration provides an interface to use the JasperReports reporting engine in an Oracle database application, specifically with Oracle Application Express (Oracle APEX).
BSD 3-Clause "New" or "Revised" License
55 stars 23 forks source link

Java 11 compatibility => Error de.oc.jasper.ReportUtilities.(ReportUtilities.java:32) #107

Closed desyayu-jpfa closed 2 years ago

desyayu-jpfa commented 2 years ago

Hi,

I have followed the instuction, but always get this error when click button "Test Report". Could you please help me ?

HTTP Status 500 - Servlet execution threw an exception type Exception report

message Servlet execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause

java.lang.ExceptionInInitializerError de.oc.integration.jasper.webapp.ReportWrapper.service(ReportWrapper.java:182) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause

java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found. org.apache.logging.log4j.LogManager.callerClass(LogManager.java:573) org.apache.logging.log4j.LogManager.getLogger(LogManager.java:598) org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585) de.oc.jasper.ReportUtilities.(ReportUtilities.java:32) de.oc.integration.jasper.webapp.ReportWrapper.service(ReportWrapper.java:182) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.76 logs.

daust commented 2 years ago

Please specify:

desyayu-jpfa commented 2 years ago

Hello,

Here are the information :

JRI version : jri-2.8.1-jasper-6.18.1

Configuration Info The current configuration is loaded from: /usr/share/tomcat/webapps/JasperReportsIntegration Config-Directory: /usr/share/tomcat/webapps/JasperReportsIntegration/conf Config-File: /usr/share/tomcat/webapps/JasperReportsIntegration/conf/application.properties Reports-Path: /usr/share/tomcat/webapps/JasperReportsIntegration/reports,/usr/share/tomcat/webapps/JasperReportsIntegration/reports/tmp Temp-Directory: /usr/share/tomcat/webapps/jri/report_tmp Logs-Directory: /usr/share/tomcat/webapps/JasperReportsIntegration/logs Java-Runtime-Version: 11.0.14.1 JasperReports-Version: 6.18.1-a122da513af8382c12c1df5654d1048ef99e378e

Classpath: /usr/share/tomcat/bin/bootstrap.jar /usr/share/tomcat/bin/tomcat-juli.jar /usr/share/java/commons-daemon.jar

Tomcat version : Apache Tomcat 7.0.76

Java version : openjdk version "11.0.14.1" 2022-02-08 LTS OpenJDK Runtime Environment Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS) OpenJDK 64-Bit Server VM Corretto-11.0.14.10.1 (build 11.0.14.1+10-LTS, mixed mode)

OS version : NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2"

Thank you

daust commented 2 years ago

Thank you for raising this. There seems to be an issue with log4j and Java 11. I will need some more time to fix this: https://stackoverflow.com/questions/53049346/is-log4j2-compatible-with-java-11

In the meantime, please use a Java environment below Java 11 like Java 8, 9 or 10. Java 8 will definitely work (I develop/test on this), the others might as well.

daust commented 2 years ago

LogManager.getLogger() doesn't work any more in JDK11. Specifying the class explicitly is mandatory.