[GLASSFISH-16164] eclipselink.weaving breaks marshalling out of the box Created: 05/Mar/11  Updated: 08/Mar/13

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 3.1_b43
Fix Version/s: None

Type: Bug Priority: Major
Reporter: netricsoft Assignee: Harshad Vilekar
Resolution: Unresolved Votes: 22
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Windows 7 and Mac OS X

Attachments: Zip Archive TestCase.zip    
Issue Links:
is related to GLASSFISH-17557 Odd deserialization fail Open
Tags: 3_1-next, 3_1_1-scrubbed, 3_1_2-exclude, corba, eclipselink, orb-review


Separately deployed EJB components that return @Entity objects, fail serialization and return empty objects to remote components (such as a managed bean in a separately deployed WAR). Adding: <property name="eclipselink.weaving" value="false"/> to persistence.xml fixes the issue, but cant be expected behavior out of the box. I tried 2 separate clean installs, and an upgrade from 3.0.1 but all have same broken behavior.

To reproduce:
1) Deploy EJB jar with a stateless EJB that returns an entity from remote interface.
2) Deploy web application with a managed bean that retrieves entity from injected EJB
3) Access managed bean from view.

I get empty entity classes (all fields null) with no errors in server.log.

I have a test case intellij project illustrating issue if required.

Comment by marina vatkina [ 07/Mar/11 ]

let's start with JPA

Comment by Mitesh Meswani [ 07/Mar/11 ]

Can you please attach the test project that you are mentioning above. That would help speed up things.

Comment by netricsoft [ 08/Mar/11 ]

Here is a video illustrating issue:


(watch in 'original' format)

The attached project assumes you have a jdbc resource jdbc/testcase setup with one table:

create table person (
id integer not null primary key,
email varchar2(80) not null

insert into person values ( 1, 'test@case.com' );

The test case contains 3 components/modules:

1) "Model", shared classes for Session and "Web" module.
Compile with EE 6.
2) "Session", an EJB component with a single EJB PeopleSessionBean. Compile with EE 6. This module contains the JPA persistence.xml WITHOUT the eclipselink.weaving property element. So it will not work until the following is added:
<property name="eclipselink.weaving" value="false"/>

3) "Web", a WAR component with a single managed bean that attempts to retrieve an entity from the remote EJB. Compile with EE 6 and Mojarra 2.1.

To reproduce issue:

Compile Model
Compile Session (include Model source)
Compile Web (include Model source)

Deploy Session component
Deploy Web component
Access web component (http://localhost/testcase/)

As is, you will get Id 0 and blank (null) for email.

Add <properties> element above to persistence-unit in persistence.xml, redeploy Session and Web and reload testcase page. You will get Id 1 and email test@case.com



Comment by netricsoft [ 14/Mar/11 ]

Will this issue be fixed? or is this intended behavior?


Comment by Mitesh Meswani [ 14/Mar/11 ]

We are still investigating. Meanwhile, a workaround is to use attribute based persistence. The issue does not manifest there.

BTW, thanks for the reproductions and cool video walk through

Comment by Mitesh Meswani [ 07/Apr/11 ]


Assigning to you to investigate why IIOP serialization layer causes this issue. I have sent you test app and instructions to reproduce this in email.

Comment by scatari [ 27/Jun/11 ]

Targeting for next release after 3.1.1.

Comment by Mitesh Meswani [ 20/Oct/11 ]

Another work around is adding property <property name="eclipselink.weaving.fetchgroups" value="false"/> to the persistence unit

Comment by jimmysklim [ 13/Dec/11 ]

Guys! Thank alot for the work around. After adding <property name="eclipselink.weaving.fetchgroups" value="false"/> it's worked.

Comment by jthoennes [ 22/Mar/12 ]

Any plans when this will be corrected?

Comment by kombatkuehn [ 27/Apr/12 ]

This issue still exists in 3.1.2 (build 23).

Comment by chrispy [ 14/Sep/12 ]

This bug is still a problem. When will this be fixed? A workaround is not a solution :-/

Comment by eldiegos [ 24/Sep/12 ]

OMG. This bug has been a pain on the neck until i found this issue. What a waste of time trying to solving it. Please glassfish team solve it.

I have vote for it.


Comment by vins4java [ 26/Feb/13 ]

I agree with eldiegos. I found this bug up to lastest and there's no way to know if it will be fixed for glassfish 4.0 or not...
What's the plan for the resolution of this bug?

Comment by markokanala [ 07/Mar/13 ]

Has anyone tried if static weaving at the remote and calling side is a workaround ?

see http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Static_Weaving

Comment by dmitriy.balakin [ 08/Mar/13 ]

I use eclipselink-staticweave-maven-plugin as a workaround.

Generated at Tue Oct 13 21:43:39 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.