I am running jboss4.0.3sp1 on linux with jdk1.5.0_05. I have a webapp that use stateless beans to access a database through entity beans. As long as I access the entity beans inside the stateless beans, I can cast and use them as the class type they are. Once they are passed back to the webapp, I get class cast exceptions if I try to cast them. I haven't been able to solve this. I have returned an entity bean and done a bean.getClass().getName() and it prints out the exact class I am trying to cast to.
entity.getClass.getName() = com.some.User
(com.some.User)entity results in ClassCastException.
I have checked the ear-deployer.xml and callbyvalue is true. Where do I go from here?