ClassCastException: java.lang.String cannot be cast to java.lang.Boolean


Very frustrated with Jaspersoft Studo 6.2.0 (loved older versions of iReport).

I am not sure why the developers of JasperStudio suite keep making it difficult to use. Older versions of iReport (3x) had a nice feature to double click on error message in the console and it would take you to the filed/object that is causing the error. With their greates JSS 6.2.0, that feature is no where to find and hence for past two hours I am not able to find where the heck this error is occuring. Could anyone throw any ideas? I've also checked the log (Windows-->Show View...) menu but it's not telling me anything about this error.

Error message: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean.

I know what the error means but I am not able to find where is it occuring. I've checked all fields, variables, parameters.

dprogrammer's picture
Joined: Jul 19 2006 - 7:37am
Last seen: 22 hours 52 min ago

6 Answers:


Did you just want to complain? It's difficult to say anything else because you only provided complaint without any information about your jrxml.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 11 months 4 weeks ago

I verified it on the last JSS version, it is working. However it is not always possible to find the right object from compilation results. You should add more information so we can test the case and improve it.

chicuslavic's picture
Joined: Apr 19 2010 - 3:18am
Last seen: 1 month 6 days ago

I got the same error when I try to implement a conversion of Big Decimal value to interger. I used the following expression with print expression:

<FieldName>.compareTo(new BigDecimal(<value>))==1?"Green Status.png":"Red Status.png" I'm using this for image status indicator field. Any help on this would be of great help.

mrampradeepraj's picture
Joined: Oct 13 2017 - 11:09am
Last seen: 2 years 3 months ago

Getting same error. No where in my jrxml code i am using boolean but error says java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean.


Very frustated with it.

ankushchhabra's picture
Joined: Oct 7 2010 - 4:22am
Last seen: 4 months 1 week ago

Iam also facing the same error in Jasper Studio Professional version.Please suggest alternate solution.

santoshtheprofessional's picture
Joined: May 14 2018 - 9:45pm
Last seen: 1 year 1 month ago


I had the same problem, and it was because of print when expression, I was typing " " and this can not be converted to boolean as it says. So I left the print when expression blanc and it works :D 

Hope this will help.


khitem.amiri's picture
Joined: Mar 23 2020 - 8:34am
Last seen: 2 months 1 week ago