struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "victorsosa (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4633) ClassCastException while generating report using Struts 2.3.28 and jasperreports 4.5.1
Date Wed, 11 May 2016 12:42:12 GMT

    [ https://issues.apache.org/jira/browse/WW-4633?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15280048#comment-15280048
] 

victorsosa commented on WW-4633:
--------------------------------

You are using ArrayList isteand of JRDataSources
It's said clearly:
{code}Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to net.sf.jasperreports.engine.JRDataSource{code}
 please use {code}new JRBeanCollectionDataSource(list){code}

I know the documentation is wrong.
Also I don't recall that you can use multiples datasources, you should check that too.

{code}
<param name="dataSource">evalationReportList</param>  <--- this is a ArrayList
<!-- <param name="dataSource">jrDataSource</param>
<param name="dataSource">mainFormsList</param> -->
<param name="dataSource">beanColDataSource</param>
<param name="dataSource">formsList</param>   <--- this is a ArrayList
{code}

> ClassCastException while generating report using Struts 2.3.28 and jasperreports 4.5.1
> --------------------------------------------------------------------------------------
>
>                 Key: WW-4633
>                 URL: https://issues.apache.org/jira/browse/WW-4633
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.3.28
>            Reporter: Irfan
>
> Im getting Exception while generating report im using Struts 2.3.28 and jasperreports
4.5.1,
> 12:42:32,430 ERROR [com.atk.common.struts2.result.JasperReportResult] (http--0.0.0.0-8080-4)
Error building report for uri D:\jboss-as-7.1.1.Final-MIG\standalone\tmp\vfs\temp9bbbed31d5b5c7fe\himma-pulmonary.war-d20a7b05840d8b89\reports\jasper\pulmonaryMainReport.jasper:
net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
>     Source text : $F{evalDs} != null
>     at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:267)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRCalculator.evaluateEstimated(JRCalculator.java:582)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:553)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRFillDataset.evaluateExpression(JRFillDataset.java:1387)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRBaseFiller.evaluateExpression(JRBaseFiller.java:1654)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRFillBand.evaluatePrintWhenExpression(JRFillBand.java:306)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:721)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:265)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
[jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836) [jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:765) [jasperreports-4.5.1.jar:4.5.1]
>     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84) [jasperreports-4.5.1.jar:4.5.1]
>     at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_80]
> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to net.sf.jasperreports.engine.JRDataSource
>     at pulmonaryMainReport_subreport1_1462949725806_561776.evaluateEstimated(pulmonaryMainReport_subreport1_1462949725806_561776:530)
   at net.sf.jasperreports.engine.fill.JREvaluator.evaluateEstimated(JREvaluator.java:254)
[jasperreports-4.5.1.jar:4.5.1]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message