Hi,
I started to use JFreeChart. Could create my demo web apps for various chart types and on Windows, the chart displays fine. When I move my servlet class files (compiled on Win XP/jdk1.4.1) and html files to Solaris 2.9 running Apache Tomcat, I could not get the PNG output on my web browser on Windows. All I get was a little red cross on top left corner.
I tried to dump a PNG file of the chart to a file on disk and that does not work either. In the following code snippet I get the println() output to Apache log file.
if (curChart != null)
{
response.setContentType("image/png");
System.out.println("Going to write the PNG output to stream.");
java.io.File png_file = new java.io.File("jfree_test.png");
ChartUtilities.saveChartAsPNG(png_file, curChart, 400, 300);
ChartUtilities.writeChartAsPNG(out, curChart, 400, 300);
}
Is there any problem for the "saveChart" and "writeChart" functions?
On Windows I do not see any of these problems.
Can any one explain what could be going wrong?
Thanks,
Surath.
Houston, TX.
PNG chart does not display from Solaris 2.9
mime type problem ?
I would bet on a mime type problem.
I just proposed a patch related to this for ServletUtilities.
Could you explain what you are trying to do with your code as it seems you are writing two charts, one on out and one in a file ?
I just proposed a patch related to this for ServletUtilities.
Could you explain what you are trying to do with your code as it seems you are writing two charts, one on out and one in a file ?
Xavier Poinsard
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Another reason might be that your server doesn't have X11 running. See this thread for info:
http://www.jfree.org/phpBB2/viewtopic.php?t=1012
Regards,
Dave Gilbert
http://www.jfree.org/phpBB2/viewtopic.php?t=1012
Regards,
Dave Gilbert
X11 and JFreeChart issue
By specifying the awt.headless=true property in catalina.sh suggested in the link provided by David, the problem is resolved.
Thanks a ton.
Surath.
Thanks a ton.
Surath.