Customer is reporting that they are getting the following when attempting an ad-hoc query in Jasper:
ERROR SecureExceptionHandlerImpl,http-nio-8080-exec-5:135 - Unable to make field transient java.util.LinkedHashMap$Entry java.util.LinkedHashMap.head accessible: module java.base does not "opens java.util" to unnamed module @4f0ca202 java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.LinkedHashMap$Entry java.util.LinkedHashMap.head accessible: module java.base does not "opens java.util" to unnamed module @4f0ca202
Error presents in the jasperserver.log., located in C:\Program Files\jasperreports-server-pro\apache-tomcat\webapps\jasperserver-pro\WEB-INF\logs
Jasper 9.0 and higher, JDK 17
The installation of Jasper was configured with JDK 17. While supported, some implementations may not operate correctly due to stricter encapsulation. When using JDK 17, attempting to use Java 9 options in Tomcat will rely on Java 8 internal API's which some JDK 17 implementations may restrict.
In the install process for Jasper 9.0, in configuring Tomcat, step 5g (section: On the Java tab, set the below options:) under Java 9 options, add the following modules using the " --add-opens " parameter syntax:
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.lang.ref=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.nio.channels.spi=ALL-UNNAMED
--add-opens=java.base/java.nio.channels=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.base/java.util.regex=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/javax.security.auth.login=ALL-UNNAMED
--add-opens=java.base/javax.security.auth=ALL-UNNAMED
--add-opens=java.base/jdk.internal.access.foreign=ALL-UNNAMED
--add-opens=java.base/sun.net.util=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
--add-opens=java.base/sun.util.calendar=ALL-UNNAMED
-Xdebug
-Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
One may also consider reconfiguring to use JVM 8 or JVM 11 in Java 8 compatibility mode.