This content has been marked as final. Show 3 replies
I posted a while back asking for advice on what was the best way to share a JBC instance for all applications on a node, http://www.jboss.org/index.html?module=bb&op=viewtopic&t=151849. The recommendation was to use JNDI and I agree.
However, I am running into the same problem that has been documented on other posts...org.jboss.cache.Cache is not Serilializable. When I try to bind a cache instance to JNDI in WebSphere 6.1 for example I get the following exception:
A NamingException is being thrown from a javax.naming.Context implementation. Details follow: Context implementation: com.ibm.ws.naming.jndicos.CNContextImpl Context method: bind Context name: HQ-M-3040Node01Cell/nodes/HQ-M-3040Node01/servers/server1 Target name: fleetcycle/cache/jboss-cache Other data: Object to bind: org.jboss.cache.DataContainerImpl [0 nodes, 0 locks] Exception stack trace: com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound.
CacheFactory factory = new DefaultCacheFactory(); Cache cache = factory.createCache(configFileName); InitialContext ctx = new InitialContext(); ctx.bind("fleetcycle/cache/jboss-cache", cache);