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?