可能重复:
java.util.ConcurrentModificationException in JasperReports
我有问题...... 我在java中有这个源代码:
HashMap<BigDecimal ,JRBeanCollectionDataSource> MyHasMap = .......
parameters.put("MyHasMap ", MyHasMap );
JRBeanCollectionDataSource有一个bean列表。
JasperFillManager.fillReport(............. , parameters, ..............);
在我的报告中,我有这个......
报告“父亲”:
<parameter name="MyHasMap " class="java.util.Map" isForPrompting="false"/>
<band height="25">
<subreport runToBottom="true">
<reportElement x="0" y="0" width="555" height="25"/>
<subreportParameter name="MyHasMap ">
<subreportParameterExpression><![CDATA[$P{MyHasMap }]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR}+
"SUBREPORT1.jasper"]]/>
</subreport>
</band>
SUBREPORT 1:
<parameter name="MyHasMap " class="java.util.Map" isForPrompting="false"/>
<group name="G_HOJA" isStartNewPage="true">
<groupExpression><![CDATA[$F{X}]]></groupExpression>
<groupFooter>
<band height="33">
<subreport>
<reportElement positionType="Float" x="10" y="14" width="535" height="15"/>
<dataSourceExpression><![CDATA[$P{totalProducciones}.get($F{X})]]></dataSourceExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} +
"SUBREPOR2.jasper"]]></subreportExpression>
</subreport>
</band>
</groupFooter>
</group>
字段X是我在报告中获得查询的字段。
SUBREPORT 2:我绘制了我的豆田
......
....
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{FIELD1}]]></textFieldExpression>
...
...
当我有一个字段X的记录都可以,但是当查询返回更多记录时...我有下一个例外:
java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.next(JRBeanCollectionDataSource.java:87)
at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:861)
at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:779)
at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1448)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:108)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:923)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:561)
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)
我使用的是jasperrepots - 3.7.0。 有人有任何想法???
由于