powered by Jive Software

CacheFactory cast error in clustring

Sorry for my English
i am using openfire 4.5 Alpha that clustered with hazelcast 2.4.2 in two node.
I’ve developed a plugin that use cache and uploaded on each node , if a node not pushed object to cache retrived it (because not have same classloader) cast exception occured.
Please let me know if anyone faced the same and solution for this.
thank you

No any one has encountered cast exception when read from cache in clustering?

try to serialize your data to String (for example build a json String) and on the other node parse the json to your object structure back…
i had the class cast exception too and this is my solution.

Thanks totzkotz for your reply
but json is slower than binary and in openfire objects like User , Roster use Cache :
UserManager => private final Cache<String, User> userCache or
RosterManager => private final Cache<String, Roster> rosterCache
and it’s work in cluster mode

This is the only solution. It’s a known problem, documented in the code, that as yet no-one has worked out how to fix.


1 Like