users@glassfish.java.net

ear - ear communication using jpa enties in remote interface

From: moralbarometer <moralbarometer_at_googlemail.com>
Date: Mon, 24 Mar 2014 23:40:28 +0100

Dear All,
I am currently trying transmit jpa entities over remote interface from one
ejb module in an ear to another ejb module in another ear to no avail using
jdk 7 and glassfish 4. When I changed the enties to a normal pojo(DTO
without jpa annotations) it works. The main problem is that the object is
structured is return to the calling ear but the values are not passed or
serialized. Summary:
-first ear contains( one ejb module, one jar containing only entities and
remote interface implemented by the ejb module. example is Account void
getAccountByID(int id) where Account is an entity).
-second ear contains (one ejb module, the persistence jar with the remote
interface). the ejb reference the ejb in first ear through the remote
interface using @EJB annotation. When the remote interface is invoke in
second ear the Account is retrieved in the first ear but in the second ear
the account attributes are set to default (null). When I change the
Account to a normal DTO everything works fine. In Glassfish 2.1/jdk 5
enviroment this code works fine but when I tried to run same code on
glassfish 4/jdk 7 it fails. Is this a JPA specification problem or EJB -
remote invocation? Are entities not allowed to leave an ear? In my case
when I call this same remote interface from another bean within the same
ejbmodule there is no problem. Please kindly help.

Best regards

moralist