users@glassfish.java.net

JBosscache integration in glassfish - best practices?

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Sep 2008 01:33:14 PDT

Hi everyone,

I'm curious about a problem I'm currently working on. I would like to integrate JBosscache as distributed cache into my webapplication (with struts) running on a glassfish cluster. I would like to store different objects or database results in the cache that should be accessible by all nodes in the cluster.

I've implemented the JBosscache as a POJO similar to a stand alone solution and it works well despite the fact that I'm not able to explicitly start or stop the cache. I Think the fact that I can't stop the cache and it's not managed by the container due to the POJO implementation is responsible for flooding my server-logs with this message after a redeploy:

PWC1635: Illegal access: this web application instance has been stopped already (the eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact)

So I would like to improve my implemenation but I'm not sure how. Is there a way to use JBosscache as any kind of service inside glassfish so glassfish could handle the cache management and lifecycle? Or are there any other options like best practices or anything like that?

I've thought about using a Servlet to handle the Cache startup and shutdown in the respective init() and destroy() methods and hand it over to the lifecycle management of the servlet container but I think I can't integrate this Servlet approach into my application.

So any help or suggestions are appreciated.

Thanks in advance
schommi
[Message sent by forum member 'schommi' (schommi)]

http://forums.java.net/jive/thread.jspa?messageID=300016