users@glassfish.java.net

Re: Toplink cast exception

From: <glassfish_at_javadesktop.org>
Date: Thu, 17 May 2007 16:16:41 PDT

ANSWER: The EntityManagerFactory was being stored in the servletContext as an Attribute so that i didn't need to create it every time the persistence entity was accessed, however i was not closing the EntityManagerFactory when the servlet was destroyed (which happens during re-deploy) and as a result there was some sort of conflict when the entity manager factory was being created and this manifested it's self as the cast error described above.
[Message sent by forum member 'arkmobile' (arkmobile)]

http://forums.java.net/jive/thread.jspa?messageID=217759