users@glassfish.java.net

Re: glassfish v3.0 / v3.1 change in JPA2; was: glassfish v3.1 & jpa: java.lang.AbstractMethodError: ...._persistence_setId(Ljava/lang/Object;)V

From: Mitesh Meswani <Mitesh.Meswani_at_Sun.COM>
Date: Wed, 03 Mar 2010 17:41:32 -0800

Hi Dominik,

EclipseLink has enhanced its weaving scheme a bit post 2.0 release.
GlassFish 3.1 builds use EclipseLink 2.1.0-M5 and has the changes. If
you are using GlassFish 3.1 nightlies, can you please make sure that
your static weave uses EclipseLink 2.1.o-M5. For the entity you
described below, javap should show you following

javap ... SomeObject | grep -i getid

     public int getId();
     public java.lang.Object _persistence_getId();
     public int _persistence_getid();

Thanks,
Mitesh

On 2/27/2010 10:05 AM, Dominik Dorn wrote:
> Ok, it seems this is changed between glassfish v3 and v3.1
>
> In Glassfish v3.1 JPA expects helper methods that have the
> same upper/lowercase combination as one would expect in
> a java bean:
>
> public class SomeObject{
>
> @Id
> private int id;
>
> public int getId(){..}
> public void setId(...){...}
>
> // helper methods required in glassfish v3.0
> public int _persistence_getid(){..}
> public void _persistence_setid(int){..}
>
> // helper methods required in glassfish v3.1
> public int _persistence_getId(){..}
> public void _persistence_setId(int){..}
> }
>
>
> I've upgraded to eclipselink 2.1.0-SNAPSHOT (was using 2.0.0)
> but the static code weaver
> still weaves the helper methods in lowercase.
>
>
> Anyone has a tip?
> How do you do your weaving with maven?
>
>
>