Problem with creation of ther report with openJDK 8 and option -r <resource>

Description

Hello,
I have trouble with jasperstarter and subreports on openJDK 8
When I tried to add this command with option -r then the jasperstarte shows me this message:
jasperstarter --locale cs process "D:\WEB\Apache24\htdocs\webpages\Invoice.jrxml" -o "D:\WEB\Apache24\htdocs\webpages\tempDir\br06ie1596t4knako1hthvs8k8" -f pdf -P TITLE="Invoice" CERTIFICATE_SERIAL_NUMBER="2A2BE9" CERTIFICATE_SERIAL_NUMBER_DATETIME="02.07.2018 22:42:14" -t xml --data-file D:\WEB\Apache24\htdocs\webpages\0c065b539066.xml --xml-xpath /INV_01 -r

Exception in thread "main" java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
at de.cenote.tools.classpath.ApplicationClasspath.add(ApplicationClasspath.java:75)
at de.cenote.tools.classpath.ApplicationClasspath.add(ApplicationClasspath.java:65)
at de.cenote.jasperstarter.App.processReport(App.java:193)
at de.cenote.jasperstarter.App.main(App.java:109)

When I use the command withnout the option -r the report created, but without subreport.
Please, where is the proble, What I do bad.
I tried it with openJDK 8, 9, 11 but still with the same error.
Thank you a lot.
The project is perfect,m but now I have this issue and I don't now how to resolve it.
Honza H

Environment

Windows Server 2016
Java:
java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b10)
Eclipse OpenJ9 VM (build openj9-0.15.1, JRE 1.8.0 Windows Server 2016 amd64-64-Bit Compressed References 20190717_421 (JIT enabled, AOT enabled)
OpenJ9 - 0f66c6431
OMR - ec782f26
JCL - f147086df1e based on jdk8u222-b10)

jasperstarter:
jasperstarter -V
JasperStarter 3.5.0-java7 Rev 76746ab (JasperStarter-3.5.0-java7)

  • JasperReports: 6.4.0

Activity

Show:
Volker Voßkämper
November 4, 2019, 3:42 PM

see

Volker Voßkämper
November 4, 2019, 3:41 PM

Hello Honza,
thanks for reporting this. It seems you are compiling with java 9 (Eclipse OpenJ9 VM). This Eclipse ships with OpenJ9 which is used by default, no matter what Java version is installed in your operating system.
You can configure your build in Eclipse to use a different JDK. But this error does not apply to Java8.

It is related to Java9+
See

Duplicate

Assignee

Volker Voßkämper

Reporter

Jan Havránek

Labels

None

Components

Affects versions

Priority

Major