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.