anand_ganesh Posted February 19, 2011 Share Posted February 19, 2011 Team,I am using IReport 3.5.2 and I am getting this error when I try to create report.================================================================ERROR: failed to generate report......Error: java.lang.ClassCastException: cannot assign instance of net.sf.jasperreports.engine.base.JRBaseRectangle to field net.sf.jasperreports.engine.base.JRBasePen.penContainer of type net.sf.jasperreports.engine.JRPenContainer in instance of net.sf.jasperreports.engine.base.JRBasePen================================================================Any suggestions please ?ThanksAnand Link to comment Share on other sites More sharing options...
szaharia Posted February 24, 2011 Share Posted February 24, 2011 Hi, Could you post the jrxml here?Thanks,sanda Link to comment Share on other sites More sharing options...
anand_ganesh Posted February 25, 2011 Author Share Posted February 25, 2011 Hello,Thank you for replying back. I found a workaround (which is not the best one, but it works) for now.Here is what I found.http://anandganesh2005.blogspot.com/2011/02/arcims-tomcat-and-ireport-issues.htmlIf you could please tell me exactly what .jar files I should copy from IReports 4 to place in which location on my server, that will help me.ThanksAnand Link to comment Share on other sites More sharing options...
szaharia Posted February 25, 2011 Share Posted February 25, 2011 Hi,First, I was thinking the problem resides in the jrxml file, but after reading the issue details it's obvious that it's a classpath matter.The jasperreports-4.0.0.jar (this is the jar containing both classes involved in the ClassCastException) should be placed either in the app's classpath, or in tomcat's common or shared lib. But once placed this jar, make sure that you removed all other older jasperreports.jar versions from the classpath and/or from the tomcat libs. Then clear the tomcat's cache and restart the server.To ensure a proper functionality for the JR 4.0, you could also include in the classpath the following jars:jasperreports-fonts-4.0.0.jarjasperreports-extensions-3.5.3.jarjasperreports-chart-themes-4.0.0.jarThen, if you still have problems, a better place to post this kind of issues is on the dedicated iReport forum.Hope this helps,sanda Link to comment Share on other sites More sharing options...
anand_ganesh Posted February 25, 2011 Author Share Posted February 25, 2011 Hi Sanda,Thank you for the reply and the tip.What happens if there are other WebApps in Tomcat and those Apps need the older version of jasperreports.jar files ?Should I have to upgrade all apps on the server ?OrIs there a way to tell Java to load Jasperreport 4 libraries for this specific application alone ?ThanksAnand Link to comment Share on other sites More sharing options...
szaharia Posted February 25, 2011 Share Posted February 25, 2011 Hi,All I could say is that different versions of the same jar coexisting in a classpath always generate problems. So, these jars have to be separated somehow. Either by upgrading all apps to use JR4.0 (if possible), or by moving this single app using 4.0 on a separate tomcat server. With all the possible implications of using 2 tomcat instances simultaneously.Regards,sanda Link to comment Share on other sites More sharing options...
anand_ganesh Posted February 25, 2011 Author Share Posted February 25, 2011 Thank you Sanda for the quick reply.At this point I know for sure there are three .jar files which if I remove my core Applications ArcIMS and GeoCortex stops working.jasper-compiler.jarjasper-compiler-jdt.jarjasper-runtime.jarSo I have to wait until these apps are ready to use the latest jasper jar files. These are from different third-party vendors.I sincerely thank you for replying back and providing me tips to make proper decissions.Have a nice day !With best regardsAnand Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now