[jboss-dev-forums] [JBoss AS 7 Development] - Re: ClassCastException with Infinispan using multiple applications
Dmitry Chuiko
do-not-reply at jboss.com
Wed Jul 18 14:41:29 EDT 2012
Dmitry Chuiko [https://community.jboss.org/people/dchuiko] created the discussion
"Re: ClassCastException with Infinispan using multiple applications"
To view the discussion, visit: https://community.jboss.org/message/748849#748849
--------------------------------------------------------------
We encountered the similar issue trying to share some objects of the same class between several applications (several ears deployed on one jboss 7 instance) using replicated cache. It is worth noting there is no such problem then applications are deployed on different jboss instances. In this case marshalling works correctly after specifying a specific classloader using: getAdvancedCache().with(<class_name>.class.getClassLoader()); But when all ears deployed in the same jboss instance the following scenario doesn't work:
1) first app put Foo object into cache
2) second app trying to get Foo object using the same key
2.1) cached object found successfully
2.2) ClassCastException occurs trying to cast the found object to class Foo because its class was loaded using classloader from the first app!
In this case cache marshalling doesn't try to determine the correct class and simply returns the existing Foo object.
Is there any opportunity to get replicated cache working in local mode? We are using 7.1.1 Final. Thanks in advance!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/748849#748849]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120718/79d5b904/attachment.html
More information about the jboss-dev-forums
mailing list