users@glassfish.java.net

Using JFreeChart&cewolf in a Cluster-Environment

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Jan 2010 09:28:01 PST

Hi there,

I'm having trouble to get my JFreechart images to render.

Here's the problem:
I'm using a GF v2.1 cluster with two nodeagents. Nearly every time I call the page with my chart, I get the error "This chart has expired.Please reload."
When I shutdown one nodeagent, everything is fine. It's also working in my local environment with only one instance.

I found out that this is some kind of session-issue. When the image is about to be displayed, I "accidenty" receive another jsessionid and the image can not be found anymore.


I found this explanation:

(1) it will produce PNG graphics object, which will be temporarily cached into a application-scoped collection with 'jsessionid'. The PNG object will NOT be immediatedly responded back to the browser.

(2)it will produce a text/html stream, which will be immediately responded to the requesting browser. For example it will look somthing like:
 ---- <HTML> <BODY> [....] {IMG BORDER="0" HEIGHT="300" WIDTH="300" ALT="" src ="cewolf;jsessionid=04D17456FD5B435B8D47E2384D0EDDEA?img =-956198779&amp;width=300&amp;height=300&amp;iehack=.png"} </td> </BODY> </HTML>
----
The HTML contains a {img src="..."} tag. The URL of the img tag points to the Cewolf Servlet. As soon as the browser receives the HTML and find the img tag, the browser fires the second HTTP GET request to Cewolf Servlet. The second HTTP GET will go to Cewolf Servlet. The Cewolf Servlet will check the cache to find out a PNG graphics object to respond. The magic is that the src attribute of img tag will contain the Identification information which JSP has assigned and passed in order to let the Cewolf Servlet identify witch of the cached PNG object instance to be sent back. 
In my sun-web.xml, I use persistence-type="replicated". 
I also tried every storage type of these: http://cewolf.sourceforge.net/new/apidoc/de/laures/cewolf/storage/package-tree.html
Does anyone have an idea? I'm out of energy for thinking :)
Greetings
Veronika
[Message sent by forum member 'tesis_glassfish' (vbrem_at_tesis.de)]
http://forums.java.net/jive/thread.jspa?messageID=382817