users@glassfish.java.net

JPA ClassLoader issue when upgrading to GlassFish 2.1

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Sep 2009 10:57:01 PDT

Hi,

I'm migrating web application from GlassFish V2UR2 to V2.1. The application uses JPA, JSF, Facelets, RichFaces, JasperReports, and Spring. I am able to get logged in and execute some SELECT queries using JPA. However, I get these errors when trying to use some of my entities:

java.lang.IllegalArgumentException: Cannot convert com.company.product.admin.security.UserAccount_at_190054a of type class com.company.product.admin.security.UserAccount to class com.company.product.admin.security.UserAccount

That doesn't make sense. There is only one copy of UserAccount deployed in GlassFish. This makes me think the copy expected by JPA was loaded by a different ClassLoader than the instance in memory?

Why would I get such a problem when it worked fine in GlassFish V2UR2?


Thanks,
Ryan
[Message sent by forum member 'rdelaplante' (ryan_at_ijws.com)]

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