users@glassfish.java.net

Re: ClassCastException

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 07 Nov 2006 09:59:49 -0800

Hi,

Do you have toplink-essentials.jar on the web side of your app? If not,
please try to add it and check if it solves the problem. If you do, we need
more details to be able to help.

thanks,
-marina

Soe Moe Kyaw @ Stephen Wang wrote:
> This happens like this;
>
> I have Entities namly User, Realm, Credential and Principal.
>
> User is associated with Realm (Many-to-One), Credential (One-to-One),
> Principal (One-to-Many).
>
> I have a web service called getUserByNameAndRealm which takes user name
> and realm name. That web method delegate to a method from Session
> Bean. The result is wrapped by a Class which includes User and Status
> of the operation. It works well when the session returns the response
> which User object is null. But when the session found the User and
> returns it, the Exception occured. So I tried to set the principal,
> credential and realm of User to null. It works well then. Why does it
> happen like that and any solution to that?
>