Pages

Thursday, March 7, 2013

weblogic error: package net.sf.jasperreports.engine does not exist

I just recently come across while deploying sample report application on weblogic. and it was giving me error for all of jasper report classes not found in stack trace.
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: C:\MW_WL12C_Domains\test\report32name_1362666859233_104255.java:4: error: package net.sf.jasperreports.engine does not exist import net.sf.jasperreports.engine.*; ^ C:\MW_WL12C_Domains\test\report32name_1362666859233_104255.java:5: error: package net.sf.jasperreports.engine.fill does not exist import net.sf.jasperreports.engine.fill.*;
I thought of why even after giving all jar files in web-inf/lib folder it did not work? after searching i found that if you tried to compile report from jrxml to jasper in your web application  it needs jdt compiler jar which was missing along with other jar. so for any report to compile and run it need all following jar and importantly to remove above errors you need jdt-compiler.jar
commonly all required jars are as below
commons-beanutils-x.x.jar, commons-collections-x.x.jar, commons-digester-x.x.jar, commons-logging-x.x.x.jar, commons-logging-api-x.x.x.jar, itext-x.x.x.jar, jdt-compiler-x.x.x.jar
more additional jars if you have database connection, chart, images etc.

3 comments:

  1. This solution (adding the "jdt-compiler.jar") did fix the "package net.sf.jasperreports.engine does not exist" error for my application running on the WebLogic application server. Thank you!

    ReplyDelete
  2. it helped me too!!! Correct the problem bellow:

    net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
    /download/wls12120/user_projects/domains/mydomain/DJR_1882_1405003668045_451514.java:4: error: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    /download/wls12120/user_projects/domains/mydomain/DJR_1882_1405003668045_451514.java:5: error: package net.sf.jasperreports.engine.fill does not exist
    import net.sf.jasperreports.engine.fill.*;

    ReplyDelete
  3. Hi rajendra,
    Thanks a lot. this solution worked for me. Searched a lot for this problem but didn't get any correct solution for it.


    Thanks a lot and keep doing this

    ReplyDelete