|
java.lang.StackOverflowError |
Posted by Lofi on Jan-20-2010 15:12 |
|
i'm getting a StackOverflowError occasionally. unfortunately i haven't found a way to reproduce it so far. i'm using the most current version for java, ie 5.0.2. here's the stacktrace, maybe you can make something of it:
07:59:02,662 ERROR [RO_BaseFrame$ExceptionHandler:3344] - java.lang.StackOverflowError
at ChartDirector.ao.a(SourceFile:229)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
...
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.a(SourceFile:253)
at ChartDirector.ao.<init>(SourceFile:708)
at ChartDirector.SurfaceChart.a(SourceFile:2256)
at ChartDirector.SurfaceChart.e(SourceFile:700)
at ChartDirector.BaseChart.layout(SourceFile:792)
at ChartDirector.BaseChart.a(SourceFile:1030)
at ChartDirector.BaseChart.makeChart(SourceFile:844)
at ChartDirector.BaseChart.makeChart3(SourceFile:849)
at ChartDirector.BaseChart.makeImage(SourceFile:942)
any ideas? |
Re: java.lang.StackOverflowError |
Posted by Peter Kwan on Jan-21-2010 00:35 |
|
Hi Lofi,
After extensive testing, we have found one way to reproduce the problem. The problem occurs if the surface chart has many data points with the same (x, y) coordindates. For example, the data may contain 1000 data points, but all of them are having the same (x, y) coordinates.
In ChartDirector surface chart, the surface is assumed to be in a form of z = f(x, y).
Multiple points with the same (x, y) coordiantes are invalid in surface charts, even if their z coordinates differ. If the data may contain points with the same (x, y) coordinates, it represents a "solid", not a surface. For example, data points distributed in a 3D lattice structure is a solid. For a surface, each data points should have a different (x, y) coordinates.
If the above is in fact the cause of the problem, there are two methods:
(a) Your code may eliminiate data points that have the same (x, y) coordinates (as these points are invalid anyway), before passing the data to ChartDirector.
(b) You may ask us to produce a patch that can detect this condition and output nothing instead of causing a stack overflow. (You cannot draw a surface with less than 3 distinct data points.)
Hope this can help.
Reards
Peter Kwan |
Re: java.lang.StackOverflowError |
Posted by Lofi on Jan-21-2010 01:08 |
|
Hello Peter,
thanks! That's exactly what was happening. However with fewer data points, ie 3. I added 3 rows with 3 columns each into a table in order to fill it with correct data later. Default values were all 0. The Surface Chart got built every time the user changed a table cell, ie also on row insert, no matter what data were in the table. On insertion of the 3rd row of zeoes it crashed.
As ChartDirector is crashing i'd rather say that it should be fixed within ChartDirector, mainly because it could also happen to other people.
Please let me know if it's fixed by you guys, otherwise i'll create a check myself.
Best regards & thanks a lot!
Lofi |
Re: java.lang.StackOverflowError |
Posted by Peter Kwan on Jan-21-2010 15:40 |
|
Hi Lofi,
Internally, ChartDirector checks for a lot of errors in the data points. The data error we miss to check is for the case of 3 or more data points that all have the same (x, y) coordinates.
We will issue a patch. I will update this thread when the patch is ready.
Hope this can help.
Regards
Peter Kwan |
Re: java.lang.StackOverflowError |
Posted by Lofi on Jan-22-2010 13:09 |
|
Hello Peter,
that's very helpful. thanks a lot in advance!
Best regards
Lofi |
Re: java.lang.StackOverflowError |
Posted by Peter Kwan on Jan-23-2010 00:13 |
|
Hi Lofi,
I have just uploaded an updated "ChartDirector.jar" to:
http://www.advsofteng.com/chartdir_java_502p1.zip
Using the updated "ChartDirector.jar" should solve this problem.
Hope this can help.
Regards
Peter Kwan |
Re: java.lang.StackOverflowError |
Posted by Lofi on Jan-24-2010 12:44 |
|
Hello Peter,
thanks! Works perfectly
Best regards
Lofi |
|