max_max_mir Posted January 12, 2011 Share Posted January 12, 2011 I am trying to run a report on JasperServer (which runs fine on iReport with Java - not Groovy), but get the following error messages - actually, 75 error messages!com.jaspersoft.jasperserver.api.JSExceptionWrapper: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:1. Cannot cast from int to Object value = (java.lang.Object)(3); //$JR_EXPR_ID=12$ <------------------->2. Cannot cast from int to Object value = (java.lang.Object)(2); //$JR_EXPR_ID=13$ <------------------->3. Cannot cast from int to Object value = (java.lang.Object)(1); //$JR_EXPR_ID=14$ <------------------->4. Cannot cast from int to Object value = (java.lang.Object)(0); //$JR_EXPR_ID=15$ <------------------->5. Cannot cast from int to Object value = (java.lang.Object)(3); //$JR_EXPR_ID=22$ <------------------->I understand the error message (somewhere there's an integer that I need to cast to the Integer Object, but my problem is I can't figure out where these errors occur. How do I tie these error messages to the source? What are $JR_EXPR_ID=12$ etc.? Can I use iReport (3.7.4) to figure out where these errors occur? The report compiles and runs successfully in iReport with Java, so I can't figure out why these errors show up when I load this to JasperServer?Any help would be highly appreciated. Post Edited by max_max_mir at 01/12/2011 17:22 Link to comment Share on other sites More sharing options...
jrslh2004 Posted February 8, 2011 Share Posted February 8, 2011 my sentiments exactly; same type of error(s) but I don't know where to begin troubleshooting, as it runs fine in ireport 3.7.6. Any advice is appreciated. Link to comment Share on other sites More sharing options...
szaharia Posted February 8, 2011 Share Posted February 8, 2011 Hi,Which version of JasperServer do you use? It might be a backward compatibility issue.This kind of errors are thrown at report compilation time, and if the report compiler is not JDK1.5 compatible, it doesn't support autoboxing.Hope this helps,sanda Link to comment Share on other sites More sharing options...
max_max_mir Posted February 9, 2011 Author Share Posted February 9, 2011 shertageWrote: Hi, Which version of JasperServer do you use? It might be a backward compatibility issue. This kind of errors are thrown at report compilation time, and if the report compiler is not JDK1.5 compatible, it doesn't support autoboxing. Hope this helps, sanda The JasperServer version is 3.7.0 I believe (is there a way to find out what version it is, if it has already been installed?) and the Java version is 1.6.0_21. I am not sure what autoboxing is, but are you recommending that I upgrade my jasperserver? Link to comment Share on other sites More sharing options...
szaharia Posted February 9, 2011 Share Posted February 9, 2011 Hi,JasperServer 3.7.0 is ok, it already is JDK 1.5-compatible. Of course, upgrading to 4.0 still remains a good idea, in order to get its new features, improvements and bug fixes. :)I continue to think that an unappropriate java compiler class was loaded from the classpath, but have no idea why. Maybe because the first found is the first loaded.Regarding the compile errors, you can get some valuable information from their message. If you take a look at the first one:1. Cannot cast from int to Objectvalue = (java.lang.Object)(3); //$JR_EXPR_ID=12$you could extract 3 helpful info: The first line 'Cannot cast from int to Object' suggests that it's a class cast matter. The JR_EXPR_ID indicates the expression 0-based index, in the same order as they are added into the jrxml template. Ie, JR_EXPR_ID=12 means the 13-th expression defined in the report template. The 'value = (java.lang.Object)(3);' indicates that the expression's class was declared as java.lang.Object, and, more important, the content of the last brackets pair shows exactly the text you wrote in the expression. One can say that the 13-th expression has the primitive int value 3 and was declared as Object type. Hope this helps, sandaPost Edited by shertage at 02/09/2011 18:13 Link to comment Share on other sites More sharing options...
szaharia Posted February 9, 2011 Share Posted February 9, 2011 My apologies for the inexactity in my previous answer. The JDK 1.5 compatibility was introduced later, in the 3.7.2 version.In these conditions, an upgrade is necessary, indeed.Best regards,sandaPost Edited by shertage at 02/09/2011 18:37 Link to comment Share on other sites More sharing options...
max_max_mir Posted February 9, 2011 Author Share Posted February 9, 2011 Thank you Sanda. I appreciate the help. I eventually ended up going through the xml file (which is a time consuming way to debug) to fix the errors. I will be upgrading the jasperserver install as well. Link to comment Share on other sites More sharing options...
christin Posted March 24, 2011 Share Posted March 24, 2011 Sanda, I'm having a similar problem but not sure how to track down the expression that is causing the problem (I'm a relative newbie to Jasper and java). When you say the n-th expression defined in the report template, what do you count as an expression - I have defaultValueExpression, variableExpression, initialValueExpression, groupExpression, printWhenExpression - are all these counted?Thanks 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