JasperReports中的java.util.ConcurrentModificationException

时间:2009-04-16 20:42:50

标签: java concurrency jasper-reports

我们在Windows上部署了一个Web应用程序到Websphere 6.1.0.19。我们偶尔会在一些报告中看到这个ConcurrentModificationException。我们在生产中使用JasperReports 2.0.5。完整的堆栈跟踪如下:

java.util.ConcurrentModificationException
      at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:464)
      at java.util.AbstractList$Itr.next(AbstractList.java:435)
      at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.next(JRBeanCollectionDataSource.java:91)
      at com.advtechgrp.bop.medical.reports.core.implementation.MedicalReportDataSourceImpl.next(MedicalReportDataSourceImpl.java:61)
      at net.sf.jasperreports.engine.fill.JRFillDataset.advanceDataSource(JRFillDataset.java:830)
      at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:748)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:1438)
      at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:111)
      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:895)      at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:817)
      at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)
      at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)
      at com.advtechgrp.bop.medical.reports.core.MedicalReportBase.getReportList(MedicalReportBase.java:160)
      at com.advtechgrp.bop.medical.reports.core.implementation.MedicalReportCreator.createJasperExporter(MedicalReportCreator.java:275)
      at com.advtechgrp.bop.medical.reports.core.implementation.MedicalReportCreator.createExporter(MedicalReportCreator.java:228)
      at com.advtechgrp.bop.medical.reports.core.implementation.MedicalReportCreator.createReportUnsafe(MedicalReportCreator.java:196)
      at com.advtechgrp.bop.medical.reports.core.implementation.MedicalReportCreator.createReport(MedicalReportCreator.java:80)
      at com.advtechgrp.bop.medical.reports.core.web.MedicalReportServlet.doPost(MedicalReportServlet.java:132)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at com.ibm.ws.cache.servlet.ServletWrapper.serviceProxied(ServletWrapper.java:282)
      at com.ibm.ws.cache.servlet.CacheHook.handleFragment(CacheHook.java:459)
      at com.ibm.ws.cache.servlet.CacheHook.handleServlet(CacheHook.java:265)
      at com.ibm.ws.cache.servlet.ServletWrapper.service(ServletWrapper.java:262)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1075)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1016)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:771)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:546)
      at com.ibm.ws.wswebcontainerservlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
      at com.ibmws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:321)
      at com.advtechgrp.bop.medical.web.filter.UrlRewritingFilter.doFilter(UrlRewritingFilter.java:132)
      at com.ibm.ws.webcontainer.filterFilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.advtechgrp.bop.medical.web.filter.GZIPFilter.doFilter(GZIPFilter.java:36)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.advtechgrp.bop.medical.web.filter.WebLogFilter.doFilter(WebLogFilter.java:69)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.advtechgrp.bop.medical.web.filter.SecurityFilter.doFilter(SecurityFilter.java:174)
      at com.ibm.ws.webcontainerfilter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:771)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:679)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:546)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
      at com.ibmws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
      at com.ibmio.async.ResultHandler$2.run(ResultHandler.java:873)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)

谢谢,
汤姆

2 个答案:

答案 0 :(得分:2)

这是由迭代器正在使用时更改迭代器的后备存储引起的。这不是与线程相关的并发问题,因为它也很容易在单个线程上完成。

关于此question

的更详细说明

现在你最大的问题是,如果你可以修复它,或者是Jasper代码中的错误。

答案 1 :(得分:1)

JasperReports现在使用版本3.5,因此可能值得检查2.0.5(您的版本)之后的更改是否已解决任何线程问题。这显然无法解决您的当前生产问题,但可能会使用新版本进行重建。

说完所有这些(并且不熟悉JasperReports)我会怀疑客户端线程代码。