JasperReports doens't give any information where the error occurs-Collection of common programming errors

When I try to run a report in JasperReports it suddenly crashes, and as far as I know, it’s because of the subreport. The problem is that it only crashes for one particular input, the others works fine. When I run the subreport for every input case that the main report shall give it, it doesn’t crash at all. The error message doesn’t give me any clue about where to look.

The server has encountered an error. Please excuse the inconvenience.

Error Message

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal

Error Trace

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal at net.sf.jasperreports.engine.fill.JRBigDecimalSumIncrementer.increment(JRBigDecimalIncrementerFactory.java:302) at net.sf.jasperreports.engine.fill.JRAbstractExtendedIncrementer.increment(JRAbstractExtendedIncrementer.java:42) at net.sf.jasperreports.engine.fill.JRCalculator.calculateVariables(JRCalculator.java:144) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:742) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:265) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:640) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205) at java.lang.Thread.run(Thread.java:619)