You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by tbush <to...@gmail.com> on 2009/11/24 21:50:15 UTC

Cmp2Generator & deleted method

All,

Toying around with using openejb embedded for unit tests of our EJB2 beans I
believe I came across an issue.  Every time I my EJBs would deploy, I would
get a "ClassFormatError: Duplicate field name&signature".  Looking at the
generated openejb cmp classes I realized there were two fields named
"deleted"; one was my bean's field, the other was a "private transient
deleted" put there by the Cmp2Generator.  Shouldn't the Cmp2Generator name
this field a little more uniquely than just "deleted"?




-- 
View this message in context: http://old.nabble.com/Cmp2Generator---deleted-method-tp26503024p26503024.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Cmp2Generator & deleted method

Posted by David Blevins <da...@visi.com>.
On Dec 9, 2009, at 2:13 PM, David Blevins wrote:

>
> On Dec 9, 2009, at 2:06 AM, tbush wrote:
>
>>
>> Thanks.  I checked out the 3.1.2 source and made the change locally  
>> to get
>> myself moving again; so don't rush to get binaries up.
>
> Oh great.  I somehow managed to mess up my changes -- got CMR  
> failures.  Send me yours and I'll see if the test suite doesn't like  
> it better.  Made a JIRA issue for it here where you can attach a diff:
>
>  https://issues.apache.org/jira/browse/OPENEJB-1116

I got the same CMR failures on that patch as well.  I spent nearly all  
day Sunday trying to figure out what might be wrong with our approach  
-- we both took the same obvious approach.  I put it down and came at  
it again today with a fresh pair of eyes and found the issue  
relatively quickly.  Basically the issue was mistakenly changing this  
"deleted" occurrence:

     private void createOpenEJB_deleted(MethodVisitor mv, CmrField  
cmrField) {
         // this.${cmrField.name}Cmr.deleted(this.${cmrField.name});
         mv.visitVarInsn(ALOAD, 0);
         mv.visitFieldInsn(GETFIELD, implClassName, cmrField.getName()  
+ "Cmr", cmrField.getAccessorDescriptor());
         mv.visitVarInsn(ALOAD, 0);
         mv.visitFieldInsn(GETFIELD, implClassName,  
cmrField.getName(), cmrField.getDescriptor());
         mv.visitMethodInsn(INVOKEVIRTUAL,  
cmrField.getAccessorInternalName(), "deleted",  
cmrField.getCmrStyle().getDeletedDescriptor());
     }

If I had read the ASM code closely I'd have seen that this "deleted"  
is a method call and not a field access.  Anyway, all fixed.

I'll update the JIRA issue shortly.

-David


Re: Cmp2Generator & deleted method

Posted by David Blevins <da...@visi.com>.
On Dec 9, 2009, at 2:06 AM, tbush wrote:

>
> Thanks.  I checked out the 3.1.2 source and made the change locally  
> to get
> myself moving again; so don't rush to get binaries up.

Oh great.  I somehow managed to mess up my changes -- got CMR  
failures.  Send me yours and I'll see if the test suite doesn't like  
it better.  Made a JIRA issue for it here where you can attach a diff:

   https://issues.apache.org/jira/browse/OPENEJB-1116

-David

>
> David Blevins wrote:
>>
>>
>> On Nov 24, 2009, at 9:50 PM, tbush wrote:
>>
>>> Toying around with using openejb embedded for unit tests of our EJB2
>>> beans I
>>> believe I came across an issue.  Every time I my EJBs would deploy,
>>> I would
>>> get a "ClassFormatError: Duplicate field name&signature".  Looking
>>> at the
>>> generated openejb cmp classes I realized there were two fields named
>>> "deleted"; one was my bean's field, the other was a "private  
>>> transient
>>> deleted" put there by the Cmp2Generator.  Shouldn't the
>>> Cmp2Generator name
>>> this field a little more uniquely than just "deleted"?
>>
>> Definitely.  Thanks for pointing this out.  It seems like the field
>> name could have the same "openejb_" prefix as the method accessor  
>> that
>> goes with that boolean.
>>
>> I'm changing it to "OpenEJB_deleted" and seeing if all is well with
>> that.  Will throw up some binaries for you to try if it checks out.
>>
>> -David
>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Cmp2Generator---deleted-method-tp26503024p26703588.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Re: Cmp2Generator & deleted method

Posted by tbush <to...@gmail.com>.
Thanks.  I checked out the 3.1.2 source and made the change locally to get
myself moving again; so don't rush to get binaries up.

Thanks again,




David Blevins wrote:
> 
> 
> On Nov 24, 2009, at 9:50 PM, tbush wrote:
> 
>> Toying around with using openejb embedded for unit tests of our EJB2  
>> beans I
>> believe I came across an issue.  Every time I my EJBs would deploy,  
>> I would
>> get a "ClassFormatError: Duplicate field name&signature".  Looking  
>> at the
>> generated openejb cmp classes I realized there were two fields named
>> "deleted"; one was my bean's field, the other was a "private transient
>> deleted" put there by the Cmp2Generator.  Shouldn't the  
>> Cmp2Generator name
>> this field a little more uniquely than just "deleted"?
> 
> Definitely.  Thanks for pointing this out.  It seems like the field  
> name could have the same "openejb_" prefix as the method accessor that  
> goes with that boolean.
> 
> I'm changing it to "OpenEJB_deleted" and seeing if all is well with  
> that.  Will throw up some binaries for you to try if it checks out.
> 
> -David
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Cmp2Generator---deleted-method-tp26503024p26703588.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Cmp2Generator & deleted method

Posted by David Blevins <da...@visi.com>.
On Nov 24, 2009, at 9:50 PM, tbush wrote:

> Toying around with using openejb embedded for unit tests of our EJB2  
> beans I
> believe I came across an issue.  Every time I my EJBs would deploy,  
> I would
> get a "ClassFormatError: Duplicate field name&signature".  Looking  
> at the
> generated openejb cmp classes I realized there were two fields named
> "deleted"; one was my bean's field, the other was a "private transient
> deleted" put there by the Cmp2Generator.  Shouldn't the  
> Cmp2Generator name
> this field a little more uniquely than just "deleted"?

Definitely.  Thanks for pointing this out.  It seems like the field  
name could have the same "openejb_" prefix as the method accessor that  
goes with that boolean.

I'm changing it to "OpenEJB_deleted" and seeing if all is well with  
that.  Will throw up some binaries for you to try if it checks out.

-David