#615 Exceptions, artifacts in multithreading environment

1.0.x
closed-duplicate
General (896)
5
2006-08-18
2006-03-17
Anonymous
No

I am using JFreeChart in a servlet environment. There is
an html page which contains about 15 diagrams, which are
generated concurrently on the server (the browser sends
more request at the same time). Recently we moved the
application to a multiprocessor machine and the same
code which worked well on the singleprocessor machine
now causes exceptions and graphics artifacts (horizontal
lines going back to the Y coordinate). The data is
coming from a database and doesn't change. When I put
"synchronized" on all servlet doGet methods, then the
system works correctly, no artifacts, no exceptions.

Here is a stack trace of a logged exception (the set of
diagrams which cause exceptions and therefore are not
rendered is randomly changing on each run, this also
justifies that it is a concurrency problem):

java.lang.IllegalArgumentException: Range(double,
double): require lower (1.1426364E12) <= upper

(1.142549999999E12).
at org.jfree.data.Range.<init>(Range.java:89)
at org.jfree.chart.axis.PeriodAxis.
getRange(PeriodAxis.java:492)
at

org.jfree.chart.renderer.xy.AbstractXYItemRenderer.
drawDomainGridLine(AbstractXYItemRenderer.java:799)
at org.jfree.chart.plot.XYPlot.
drawDomainGridlines(XYPlot.java:2745)
at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:
2147)
at org.jfree.chart.JFreeChart.draw(JFreeChart.
java:1039)
at org.jfree.chart.JFreeChart.
createBufferedImage(JFreeChart.java:1213)
at org.jfree.chart.JFreeChart.
createBufferedImage(JFreeChart.java:1193)
at org.jfree.chart.ChartUtilities.
writeChartAsPNG(ChartUtilities.java:174)
at org.jfree.chart.ChartUtilities.
writeChartAsPNG(ChartUtilities.java:120)
at servlet.tools.Statistics.
getRegistrationsByGamesDiagram(Statistics.java:125)
at servlet.tools.ToolsServlet.doGet(ToolsServlet.
java:135)
at javax.servlet.http.HttpServlet.
service(HttpServlet.java:689)
at servlet.TemplateServlet.
service(TemplateServlet.java:49)
at javax.servlet.http.HttpServlet.
service(HttpServlet.java:802)
at org.apache.catalina.core.
ApplicationFilterChain.
internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.
ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:173)
at org.apache.catalina.core.StandardWrapperValve.
invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.
invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.
AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.apache.catalina.core.StandardHostValve.
invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.
invoke(ErrorReportValve.java:105)
at

org.apache.catalina.valves.FastCommonAccessLogValve.
invoke(FastCommonAccessLogValve.java:495)
at org.apache.catalina.core.StandardEngineValve.
invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.
service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.
process(Http11Processor.java:869)
at

org.apache.coyote.http11.
Http11BaseProtocol$Http11ConnectionHandler.
processConnection(Http11BaseProto

col.java:667)
at org.apache.tomcat.util.net.PoolTcpEndpoint.
processSocket(PoolTcpEndpoint.java:527)
at

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.
ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

We are using TimeTableXYDataset, in an old forum post I
read that the problem may be related to that.

Discussion

  • hontvari

    hontvari - 2006-03-17

    Logged In: YES
    user_id=880530

    I quickly searched the "data" source directory and noticed a
    few static DateFormat and Calendar member variables, including
    one named WORKING_CALENDAR. Neither DateFormat nor Calendar
    are designed to be thread safe, maybe this causes the problem.

     
  • David Gilbert

    David Gilbert - 2006-08-18

    Logged In: YES
    user_id=112975

    I suspect you are right - see also bug 1536558. I'm working
    on a solution for 1536558, so I'm closing this report.

     
  • David Gilbert

    David Gilbert - 2006-08-18
    • assigned_to: nobody --> mungady
    • status: open --> closed-duplicate
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks