ClassCastException in JPA Entitiy after redeploy (Glassfish 3.1.2)
问题 I have a strange effect when undeploying and deploying a WebArchive (.war) with Glassfish 3.1.2. $ asadmin undeploy myWebApp; asadmin deploy target/myWebApp.war It deploys normally, but when I fetch an entity bean via the entity manager, it throws an Exception: [#|2012-12-11T15:26:09.772+0100|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=119;_ThreadName=Thread-2;|java.lang.ClassCastException: org.YourEntity cannot be cast to org.YourEntity The