My situation is as follows :
I use an MBean service which contains a HashTable (which is bound to a specific JNDI Name) to hold a bunch of Objects inside JBoss , in order for them to be persistent, i.e. to exist inside the JVM as long as JBoss is running.
I then manipulate the objects and execute methods on the server using a simple EJB wrapper around all the methods, and then calling them from a client.
This is a rapic protoyping scenario, hence I am constantly redeploying the classes (using a Jar file), the objects of which I hold in the Hashtable.
I usually delete the reference of any object of a class that i am redeploying from the Hashtable.
But sometimes when I redeploy the classes(as a jar file) and try to instantiate an object, I get a ClassCastException.
Please explain to me what the problem could be and how I can go about solving this issue.