Home > Jasper, Java, JBoss, WebLogic > java.lang.ClassCastException: YOUR_REPORT_NAME_1290416522329_455758 cannot be cast to net.sf.jasperreports.engine.fill.JREvaluator

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

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.

Advertisements
Categories: Jasper, Java, JBoss, WebLogic Tags: , , ,
  1. Luis Novo
    27 December 2010 at 3:56 pm

    You saved my life, man, thanks a lot 🙂

  2. Nee
    18 March 2011 at 8:55 pm

    I have the jar file under WEB-INF/lib folder and I tried moving around, Also I have define it on weblogic class loader on commonEnv.cmd Still does nopt work, Please help.

    Thanks

    • 20 March 2011 at 9:50 am

      Hello Nee, moving the jar file into different locations should work. Can you check if you have more than one jasper jar files?

      • nee
        5 April 2011 at 4:55 pm

        Thanks for reply, I have only jasper-compiler-jdt.jar other than jasperreport 4.0.1.jar

  3. 5 April 2011 at 6:53 pm

    Do you need to compile your reports during runtime? Otherwise you might as well remove your jasper-compiler-jdt.jar and try again.

  4. iamedu
    9 July 2011 at 10:24 pm

    What if it is maven?

    • 11 July 2011 at 5:43 am

      It should be the same. Just put the jar files somewhere where maven can find them.

  5. Anon
    16 August 2013 at 3:27 pm

    Years later, thanks, your post made me realize the obvious… I had an old Jasper lib tossed into the server lib folder.

  1. 7 September 2014 at 4:32 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: