ppareit Posted March 12, 2008 Share Posted March 12, 2008 Hi, I have created a report with ireports 2.0.4 and I want to run it from my webapplication (tomcat6 - jdk1.6) I get the following error, looks like the jasper reports compiler uses a pre jdk1.5 compiler. net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:1. Cannot cast from boolean to Boolean value = (java.lang.Boolean)(false);//$JR_EXPR_ID=8$ <------------------------>2. Cannot cast from boolean to Boolean value = (java.lang.Boolean)(false);//$JR_EXPR_ID=8$ <------------------------>3. Cannot cast from boolean to Boolean value = (java.lang.Boolean)(false);//$JR_EXPR_ID=8$ <------------------------>3 errors Thanks in advance Link to comment Share on other sites More sharing options...
dnvsrikanth Posted March 12, 2008 Share Posted March 12, 2008 hi ppareit, In which case are you getting this error. I mean whether while using a variable or a parameter?? Thanks & Regards,DNV Srikanth Link to comment Share on other sites More sharing options...
ppareit Posted March 12, 2008 Author Share Posted March 12, 2008 Hi Dnvsrikanth, I don't use variables, parameter or scriptlets. I think my report is compiled with a jdk1.3 so I need to look how to change to JDK1.5. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted March 13, 2008 Share Posted March 13, 2008 Hi ppareit, I dont think that it is the problem of JDK versions. I strongly believe that there is a type mismatch in the report itself. Thanks & Regards,DNV Srikanth. Link to comment Share on other sites More sharing options...
zgibek Posted March 13, 2008 Share Posted March 13, 2008 Well, I think the autoboxing is not working for you. Check expressions which returns true/false (like print when...) and substitue your primitive boolean types with Boolean object, ie. new Boolean(your-expression) or just Boolean.valueOf(your-expression) -- hope this helps, zgibek Link to comment Share on other sites More sharing options...
lucianc Posted March 13, 2008 Share Posted March 13, 2008 ppareit wrote:I get the following error, looks like the jasper reports compiler uses a pre jdk1.5 compiler. See this FAQ. HTH,Lucian Link to comment Share on other sites More sharing options...
debasishsahoo8523 Posted December 12, 2019 Share Posted December 12, 2019 I was also getting the same error, finally it has been solved for me:1. Go to the Source of the jrxml.2. Do ctrl + F to find "false"3. Replace the false value with "" This will resolve the issue of Cannot cast from boolean to Object. Hope it's help for you also :) 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