e.g. we got:
net.sf.jasperreports.engine.JRException: ...
Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException:
Error evaluating expression for source text:
$P{REPORT_SCRIPTLET}.setTestRaw_LogOn_TstMsgOn(true, true)
Caused by: java.lang.LinkageError: loader constraint violation: loader
(instance of java/net/FactoryURLClassLoader) previously initiated loading
for a different type with name "org/slf4j/Logger"
running in Eclipse (Kepler) Preview with JR plugin v6.1.0, but not with another Eclipse running with 5.5.1.final
Obviously we are using some build-path-referenced custom report scriptlet which itself is using the slf4j api for logging.
It seems to be conflicting with another different version of the same class (for the same underlying class loading isolation).
(Whoo ... finally at least an acceptable workaround for this obviously groovy class loading problem had been found)
We created some very simple helper report hlprep.jrxml
that itself
uses the mentioned scriptlet
set it to language=java
language=groovy
to java
to get rid of the above error, but that is often not an option)(Now it should run fine in Preview
)
Every time you experience this error (it may be random since the class loading may have been correct, depending on what you did before in your IDE) we can now do the following:
open the hlprep.jrxml
Open with ... JasperReports Preview
(so you do not have to explicitely open the Preview in further steps)restart your Eclipse
select/preview the hlprep.jrxml
select/preview the (already open) other report(s) that fail(s)
It should run fine now, even after changes, but may fail if you open/close the new ones again. (since the classes may get recycled or the groovy class loader isolation magic loads it differently)
pom.xml
Jaspersoft Server Library
, JasperReports Library Dependencies
jasperreports-6.3.0.jar
in the pom.xml
and some (not via some public Maven repo available) server jars as a User Library
to the project (which we copied over from the server)pom.xml