users@glassfish.java.net

Re: [eclipselink-users] GFv3 + EclipseLink >=2.1.1: Remote EJB client cannot transfer JPA entities through remote session bean

From: Xavier Callejas <xavier_at_wflogistics.com>
Date: Fri, 17 Dec 2010 09:21:19 -0600

On Vie 17 Dic 2010 07:30:25 Tom Ware escribió:
> Have you posted this to the GlassFish mailing list? It is not obvious from
> the portion of the exception you are posting what could be wrong in
> EclipseLink. Is there a longer exception trace somewhere?
>

Yes, I am also tracking this in GF user list.

The stacktrace says nothing regarding EclipseLink but I think the problem is
related to it because of a weaving issue.

> The only thing I can think of in EclipseLink that could cause marshalling
> exceptions is our weaving. Try setting the persistence unit property
> eclipselink.weaving to false. If that helps, it will give us somewhere to
> start looking.

Yes!, when I disable weaving with:
   ...
   <property name="eclipselink.weaving" value="false"/>
   ....
in persistence.xml the problem stops.

Adding a entity class in persistence.xml (plus weaving enabled) as:
   ...
   <class>com.xxx.xxx.model._2.jpa.Unlocodes</class>
   ...
makes that class "untransferable" by remote EJB.

Curious is that the remote client can retreive a entity class using remote ejb
method, but can't send the entity to the server (the problem is just in one
direction), for example:

   ...
            Properties props = new Properties();
            props.setProperty("org.omg.CORBA.ORBInitialHost", "zeus");
            props.setProperty("org.omg.CORBA.ORBInitialPort", "55537");
            InitialContext ic = new InitialContext(props);
            ServiceBeanRemote sb =
                    (ServiceBeanRemote) ic.lookup(
                        ServiceBeanRemote.class.getCanonicalName());

            // This will work:
            Unlocodes entityInstance = sb.find(Unlocodes.class, "USMIA");

            // This won't work !!!
            sb.send(entityInstance);
   ...

As I said before with weaving disabled the problem don't occur and the entity
instace got transferred.

Regards.
Xavier.