ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Problem in generating chart on Websphere
Posted by User on Jun-30-2011 05:41
Hi,

I am using the ChartDirector API to generate pie charts, running through a web application.
It works okay, however after awhile (a few days or so), the pie chart stops generation, The
image that displays on the screen is not generated correctly.  Once restarting websphere, it
works normally again.  Can someone let me know what may be causing this?

  Re: Problem in generating chart on Websphere
Posted by Peter Kwan on Jun-30-2011 23:55
Hi User,

If the chart is still generated, but it is not what you expect, please perform the followings:

(a) Right click on the chart, and select "Save Picture As" to save a copy of the chart.

(b) Copy "ChartDirector/jspdemo/cdinfo.jsp" to your web server, and access it.

(c) Then restart "websphere" (which according to your message, should fix the problem) to get the correct chart. Select "Save Picture As" to save a copy of the correct chart.

Please kindly inform me what are the results of (a), (b) and (c). If it is not obvious why the chart in (a) is not expected, please include an explanation why you think it is not expected.

Some common issues and the diagnostic methods are:

(i) The chart does not seem to reflect the data. To diagnose the problem, please display a timeStamp or a serial number to the chart, and also displays the data values you are using (or the first few data values if there are too many data values). For example, you may incorporate the above information in the chart title. This can confirm if the chart you see is really an updated chart (instead of from cache), and that your code has really passed the expected data to the chart.

(ii) The chart does not have any text. This is usually a font issue, common on OS that does not have standard fonts (Linux or UNIX like OS). The Java VM in this case may use the X font server to get the fonts (unless you explicitly start the Java VM in headless mode). If there is some networking problem, or the X font server connection is somehow broken, the Java VM will not have any font to use. The "cdinfo.jsp" should identify the problem.

Regards
Peter Kwan

  Re: Problem in generating chart on Websphere
Posted by Kiran Sattikar on Aug-02-2011 18:23
Hello Peter,

I'm also facing same issue. I'm using ChartDirector Ver 5.0 (Java Edition).
This issue is specific to one environment with WebSphere ND 6.1 (Fix Pack 11). Issue is not replicated in other WAS servers with WebSphere ND 6.1 (Fix Pack 33). Pie chart are not rendered correctly with following two cases

A) Exploded sector is not rendered and rest sectors are rendered in one color only.
B) My web application throws out me to error page of application as soon as render the pie chart.

Once server is restarted issue gets solve. Once this issue is occurred then all other pie charts also are not rendered correctly.
Please suggest the solution to this problem.
Following is stack trace.

java.lang.ArrayIndexOutOfBoundsException
? ? ? ? at ChartDirector.bK.a(SourceFile:97)
? ? ? ? at ChartDirector.Sector.getImageCoor(SourceFile:523)
? ? ? ? at ChartDirector.PieChart.a(SourceFile:523)
? ? ? ? at ChartDirector.BaseChart.getHTMLImageMap(SourceFile:965)
? ? ? ? at ChartDirector.BaseChart.getHTMLImageMap(SourceFile:969)
? ? ? ? at com.ibm._jsp._grtgraphs._jspService(_grtgraphs.java:214)
? ? ? ? at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBas

Regards
Kiran Sattikar

  Re: Problem in generating chart on Websphere
Posted by Peter Kwan on Aug-03-2011 00:50
Hi Kiran,

The error is most likely caused by JIT compilation issues in the Java VM.

In JIT compilation, the Java VM will compile the Java byte code into native code on the fly for faster executation. The design of the Java VM is that it will only compile the part of the Java byte code is used frequently.

After generating a number of pie charts, the Java VM decides that part of the pie chart byte code is used frequently, so it compiles them into native code on the fly. However, the compilation is incorrect. When the native code is actually run, it results in the error you see. Also, all future pie charts will use the incorrect native code and produce similar errors. Restarting the server solves the problem because the native code is not presistent.

The issue is likely to be related to that some versions of IBM Java VM may not correctly JIT compile byte code generated by some versions of SUN Java VM. (Our code is compiled with SUN Java VM.) That explains why the problem only occur in "Fix Pack 11" but not in "Fix Pack 33". Switching the IBM Java VM or the SUN Java VM may solve the problem.

We do have a ChartDirector JAR file that is compiled with a different Java VM. We have sent that to a customer that encounter similar issues with WebSphere, and it seems to solve the problem in that case. May be you can try the alternatively compiled ChartDirector JAR to see if it can solve the problem:

http://www.advsofteng.com/chartdir_java_502p3_alt.zip

Hope this can help.

Regards
Peter Kwan

  Re: Problem in generating chart on Websphere
Posted by Kiran Sattikar on Aug-03-2011 15:57
Hello Peter,

Thank you for the analysis provided. This helped alot and will change the JVM accordingly.

Regards
Kiran Sattikar.