Hmm we need more details... like the source code and the line where the error happens...
I am using entity beans and the enitity beans is accessed using a session bean. The insertion and updation works perfectly fine when I run the applicaiton immediately after JBOSS is started. THe application works perfectly alright.
The problem is, when I do a hot redeployment after making some changes in the bean and try to do insert by calling create method, then ClassCastException comes. The application works fine after restarting the JBOSS server. Though my applicaiton works fine after restarting the server, my worry is that , while running whether this exception will be thrown or not.
How can I solve this problem
So, where is your source code? Hard to tell what's wrong when you don't post it.
I had the same problem, occured after upgrade from 3.0.6 to 3.0.7.
I was using some parameters to the InitialContext constructor that turned out not to work so well from 3.0.7 and upwards, when both client and ejb container were running in the same JVM.
Try to use the InitialContext() constructor that takes no params.