[jboss-user] [JBossCache] - ClassCastException/instanceof fails when getting object from

dode do-not-reply at jboss.com
Wed Oct 10 04:58:53 EDT 2007


I am replicating a custom type in my JBossAS 4.0.5 cluster. It is working just great, but when I get an object put in the cache by one node on another, instanceof fails and if I just cast to the type I get a ClassCastException.
In the debugger I can see it is the expected type - but somehow it is not the same.
The type in question is a simple bean with some fields and getters/setters. I added a serialVersionUID to it and packed it in a JAR that I added to both the WAR which puts/gets the objects in/from the cache as well as to JBOSS_HOME/server/default/lib, since I get a NoClassDefFoundError when the objects a deserialized if I don't put it there.

I'm sure it's me who is doing something wrong - but what?

In general - is it wise at all to put custom types in the cache or should it better be just a Map with Strings and so?

Torsten

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093356#4093356

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093356



More information about the jboss-user mailing list