Moved to user forum.
1) You probably have a copy of ShoppingCart interface class in your war?
2) Is ShoppingCart a local or remote interface? If it is remote, it should be ok to have a copy. If it is a local interface, then you have classloaer issues. Why? Well, a WAR file is required to look in itself for a class before going outside the WAR. So, it picks up the ShoppingCart class from the war, but JNDI returns a proxy that was created by the EJB container.
Thanks a lot.
The ShoppingCart is a remote interface.It's in the war.
When the ShoppingCartBean was annovated @Stateless,all things went properly.But when the ShoppingCartBean was annovated @Statefull,It raised the ClassCastException.
Is it a bug or not?
Sorry,that's my fault,I shouldn't pack the remote interface into my war archive.
It's OK now!Thank you again.