jfreechart is not displaying in my production server

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

jfreechart is not displaying in my production server

Post by muthuram » Sat Dec 06, 2008 12:16 pm

Hi Friends,
I am using JFreeChart in my web application. I managed to display the charts in my local host server and was very happy to see its working until i upload it in to my production server.

Charts are not displaying in my production server which is having tomcat 5.0.27.Does this version has any issue on displaying the charts?

I am working hard to find a solution. please help me with any suggestions and solution.

Thanks,

Muthu

iogan18tm
Posts: 24
Joined: Tue May 04, 2004 5:14 pm

Post by iogan18tm » Sat Dec 06, 2008 1:11 pm


muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Sat Dec 06, 2008 3:15 pm

Hi,
thanks for your suggestion. that helped me think about my problem in different way. but the problem is java is platform independent right? the article guided me to use headless Awt toolkit. In my application the production server is Linux and my work machine is windows. i still didn't get an exact solution. help me pl.

iogan18tm
Posts: 24
Joined: Tue May 04, 2004 5:14 pm

Post by iogan18tm » Sat Dec 06, 2008 11:32 pm

You should run your application on linux with java system property -Djava.awt.headless=true. If it should be working on j2ee container like tomcat or oc4j or weblogic or jetty and so on - you should pass this parameter when starting the container

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Sun Dec 07, 2008 6:04 pm

muthuram wrote:Hi,
but the problem is java is platform independent right? the article guided me to use headless Awt toolkit.
Java-applications are platform independent by running inside a Java-Virtual Machine, which is platform dependent. Please, read the ReadMe file of your JDK and look for explanations of what the headless mode is and what it does.

As a programmer you should have some basic knowledge on how your code is going to run, or you will most likely face some similar platform-specific issues later.

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Wed Dec 10, 2008 6:14 am

JFreeChart chart = ChartFactory.createPieChart3D("", pieDataset, true, true, false);%>
<%="chart ="+chart%>
<%



// Write the chart image to the temporary directory
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
String imageMap = ChartUtilities.getImageMap("map", info);
session.setAttribute("imageMap",imageMap);
filename = ServletUtilities.saveChartAsPNG(chart, 300, 350, null, session);


// Write the image map to the PrintWriter
ChartUtilities.writeImageMap(writer, filename, info,true);
writer.flush();


}
catch (Exception e) {
System.out.println("Problem occurred creatingPie chart." +e);
}
System.out.println("filename"+filename);
String graphURL =request.getContextPath() + "/servlet/DisplayChart?filename=" + filename;
System.out.println("graph"+graphURL);
%>
<%="filename ="+filename%>



hello friends,

above is my code for generating and displaying graph in my web app(this is a sample). In this I am getting some instance like "chart =org.jfree.chart.JFreeChart@19cceab" when i print the output of chart. but i am not getting the filename. it is showing no values(empty). I think the problem is not with the server configuration as we discussed earlier. but anyway I couldn't find exact error. could any body suggest me a solution pl.

Thanks,
Muthu

sirim
Posts: 2
Joined: Tue Sep 04, 2018 4:26 pm
antibot: No, of course not.

Re:

Post by sirim » Mon Sep 17, 2018 8:41 pm

muthuram wrote:
Sat Dec 06, 2008 3:15 pm
Hi,
thanks for your suggestion. that helped me think about my problem in different way. but the problem is java is platform independent right? the article guided me to use headless Awt toolkit. In my application the production server is Linux and my work machine is windows. i still didn't get an exact solution. help me pl.
I am having the same problem.We set headless=true and still the graph is not displaying.I am getting message"Negative Values will not be displayed on the graph " error on Weblogic server in dev environment.Any clues will be helpful.

Locked