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

Message ListMessage List     Post MessagePost Message

  Issues with ChartDirector Java version
Posted by Vinny on May-31-2022 01:20
Attachments:
Hi.

We are currently using the Java version of ChartDirector 4.1 for our web-based application that uses IIS for hosting. We have been using the jar file for many years now to generate graphs and charts using the data that we have, however, we had never faced an issue like that of what we have now.

We have been noticing recently, perhaps from the past 6 months, that the graphs are not getting generated in a consistent manner. We have the necessary requirements for ChartDirector in place, but the output isn't getting generated on some of our systems, but is getting generated on others. For eg, the application works seamlessly on our Windows Server 2019 system, but generates the error message on Windows 10 and Windows Server 2016. The same applies to our Linux systems, were we are seeing an  erratic behavior on RHEL 7, RHEL 8 and Suse 12 systems. Even the systems hosted on our Cloud are producing errors.

The issue is rather troublesome for us because there is no explanation as to why the graphs are getting generated on some systems and not on others. We have the same parameters and environment variables on all our systems, more so that the dependencies have the same versions across all OS. Yet, we have one Windows 10 system generating the graphs and another Windows 10 system producing the error. I shall attach the error image for your reference.

It would be of great help if we could get any explanation as to why the inconsistency is occurring. We have tried all possible solutions from our side, even whether the problem applies to all systems of any specific OS. But the behavior is completely random with no explainable root cause. It is almost as if the jar file chooses to run on some and not on others

Hoping to hear from you at the earliest.

Regards,
Vinny
G00049A.GIF

  Re: Issues with ChartDirector Java version
Posted by Peter Kwan on May-31-2022 17:14
Hi Vinny,

The image in your message does not seem to come from ChartDirector.

I suspect there may be an exception is generated during code execution. May be the exception is caught by some other code and it outputs the error image. Or may be some of your charting code encountered some error conditions, and it outputs this error image. (Most code contains a lot of error checking, such as checking database connection, user input, etc.)

For your case, first, determine where does the error image come from. Then trace that part of the code to see why it outputs the error image.

If there is an exception and it is not caught, in most systems, it will generate an error log, so your error log file may show some useful information. If it is caught and handled by your code, it may not generate an error log, so you would need to trace your code to see what is the exception and where does it come from.

ChartDirector 4.1 was released 15 years ago. It is known that its JPEG output code is no longer supported in recent versions of Java. Normally, the Java VM uses "Just In Time" compilation to compile the Java byte code to native code, which means the affected code will not be compiled if it is not actually used. However, I remembered there were Java systems that would pre-compiled all the Java byte code to native code, in which case it will produce errors even if your charts are not output in JPEG.

If you have a test system that can consistently reproduce the problem, you may try to replace the "ChartDirector.jar" with the latest version downloaded from our web site to see if it can solve the problem.

If your code uses "session variables" (charts that have tooltips or are clickable may use session variables), and your system is a sort of "server farm" or "server garden", please make sure your system is configured to have consistent session variables.

A typical usage of session variable is like:

(a) Some code generate a chart and store it in a session variable. The code then outputs an <IMG> tag with a URL to download the chart image.

(b) When the browser receives the <IMG> tag, it uses another HTTP connection to download the chart image using the URL.

In a server farm, the (a) and (b) can potentially be handled by different servers. If this is the case, step (b) will fail because there chart is stored on a different server.

In many systems, the server farm is configured to guarantee all requests by the same client will be handled by the same server, or it may be configured to store the session variable in some centralized storage retrievable by all servers in the farm. This would avoid the problem. However, I have seen systems that simply distribute the request to the server with the least load, and this may create the problem in step (b).

Best Regards
Peter Kwan