jvm crash while using jfreechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
senthil
Posts: 12
Joined: Thu Apr 17, 2008 8:48 am

jvm crash while using jfreechart

Post by senthil » Thu Apr 17, 2008 8:57 am

ss

david.gilbert
JFreeChart Project Leader
Posts: 11732
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Apr 17, 2008 9:07 am

Details?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide

senthil
Posts: 12
Joined: Thu Apr 17, 2008 8:48 am

details of jvm crash when calling jfreechart

Post by senthil » Thu Apr 24, 2008 6:42 am

hi

sorry , for my last post .

ok then we can go for problem .

i am trying to create the image on jsp using servlet

doGet(HttpServletRequest request, HttpServletResponse response){

String chartName = (String)session.getAttribute("CHARTNAME");
JFreeChart chart = (JFreeChart)session.getAttribute(chartName);
response.setContentType("image/png");
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
BufferedImage bufferedImage = chart.createBufferedImage(700,400,null);
PngEncoder pngEncoder = new PngEncoder(bufferedImage,false,0,9);
response.getOutputStream().write(pngEncoder.pngEncode());

}



jsp(calling of servlet) :

<IMG src="/(servletname)" usemap="#map">

error trace:

at sun/awt/X11/XlibWrapper.XSync(JI)V(Native Method)
at sun/awt/X11/XToolkit.XSync(XToolkit.java:835)
^-- Holding lock: java/lang/Class@0x7f822148[recursive]
at sun/awt/X11/XToolkit.RESTORE_XERROR_HANDLER(XToolkit.java:125)
at sun/awt/X11/XWM.getWMID(XWM.java:607)
at sun/awt/X11/XWM.getWM(XWM.java:559)
at sun/awt/X11/XWM.init(XWM.java:1169)
at sun/awt/X11/XToolkit.<init>(XToolkit.java:320)
at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)
at jrockit/vm/Reflect.invokeMethod(Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Native Method)
at sun/reflect/NativeConstructorAccessorImpl.newInstance0(Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Ljava/lang/Object;(Native Method)
at sun/reflect/NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun/reflect/DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java/lang/reflect/Constructor.newInstance(Constructor.java:494)
at java/lang/Class.newInstance0(Class.java:350)
at java/lang/Class.newInstance(Class.java:303)
at java/awt/Toolkit$2.run(Toolkit.java:833)
at jrockit/vm/AccessController.doPrivileged(AccessController.java:233)
at jrockit/vm/AccessController.doPrivileged(AccessController.java:241)
at java/awt/Toolkit.getDefaultToolkit(Toolkit.java:804)
^-- Holding lock: java/lang/Class@0x255626c8[thin lock]
at javax/swing/UIManager.initialize(UIManager.java:1262)
at javax/swing/UIManager.maybeInitialize(UIManager.java:1245)
^-- Holding lock: java/lang/Object@0x7f5e1790[thin lock]
at javax/swing/UIManager.getDefaults(UIManager.java:556)
at javax/swing/UIManager.getColor(UIManager.java:590)
at org/jfree/chart/JFreeChart.<clinit>(JFreeChart.java:237)

versions of jfreehart

jfreeversion 1.0.1.jar
jcommon 1.0.0.jar

:wink: :wink:

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

Post by Taqua » Sat Apr 26, 2008 10:08 am

You are running a server but are not in headless mode. Studdy the FAQ (or Google) on how to enable Headless-Mode and your server shall ran a lot better.

senthil
Posts: 12
Joined: Thu Apr 17, 2008 8:48 am

i need a clarification

Post by senthil » Wed Apr 30, 2008 6:52 am

thanks for your reply ..


anyhow while running the server in headless mode cause headless

exception too.

i need a suggestion about few lines which i mentioned above ..

senthil
Posts: 12
Joined: Thu Apr 17, 2008 8:48 am

Post by senthil » Wed Apr 30, 2008 7:24 am

i can't simulate the situation of the JVM crash ....

however its working fine at some time ...

but before going to solve this issue ....

i have to simulate the cause for reason and when it occurs

i understand and i found out the reason for cause ......(due to headless mode of server setting)

but i can't identify when it occurs ...(since its working at some time)

but lot of time i have tried it , i can't simulate the error ....


please help me .... :?:

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

Post by Taqua » Wed Apr 30, 2008 6:04 pm

A headless exception is thrown if you try to instantiate a AWT-Window or AWT-Frame. Usually this is the case if you just copy&paste some demo code that extends DemoFrame or ApplicationFrame or such classes that extend Frame itself.

Show me a stacktrace and I can tell you which class is the frame ;)

Post Reply