Archive

Archive for the ‘Jasper’ Category

java.lang.ClassCastException: YOUR_REPORT_NAME_1290416522329_455758 cannot be cast to net.sf.jasperreports.engine.fill.JREvaluator

3 December 2010 9 comments

Another classloading issue. While jasper reports work fine on JBoss, on WebLogic they fail with the exception

net.sf.jasperreports.engine.JRException: Error loading expression class : MYREPORT_1290416522329_455758
...
Caused by: java.lang.ClassCastException: MYREPORT_1290416522329_455758 cannot be cast to net.sf.jasperreports.engine.fill.JREvaluator
at net.sf.jasperreports.engine.design.JRAbstractJavaCompiler.loadEvaluator(JRAbstractJavaCompiler.java:101)

This is easily resolved. In my configuration it was just a matter of moving my jasper jar file from the root of ear to the WEB-INF/lib folder of my web app, in order to be picked up by a different classloader. If this does not work try moving the jasper jar file around in different locations, one of them will work.

Categories: Jasper, Java, JBoss, WebLogic Tags: , , ,