Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Duplicate method exception for subclass properties with same name when using proxy classes
[Teneo] Duplicate method exception for subclass properties with same name when using proxy classes [message #491163] Tue, 13 October 2009 13:55 Go to next message
Frank Grimm is currently offline Frank GrimmFriend
Messages: 22
Registered: July 2009
Junior Member
Dear newsgroup,

Teneo (actually Hibernate's javassist) throws an
javassist.bytecode.DuplicateMemberException (see below)
when I use the following class hierarchy:

* Class FunctionalDesignElement (abstract)

* Class FunctionalParameter (superclass: FunctionalDesignElement)
** Attribute "type" : EString

* Class FunctionInterfaceEnd (superclass: FunctionalDesignElement)
** Reference "type" : DataType (0..1; not contained)

* Class DataType

When I use Teneo's proxy mechanism (PersistenceOptions.SET_PROXY ==
"true"), the following exception gets thrown by Javassist:

2364 [main] ERROR org.hibernate.proxy.pojo.BasicLazyInitializer -
Javassist Enhancement failed: sdedummy.impl.FunctionalDesignElementImpl
java.lang.RuntimeException: duplicate method: getType in
sdedummy.FunctionalDesignElement_$$_javassist_0
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:344)
at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory. java:314)
at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.j ava:273)
at
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer. getProxyFactory(JavassistLazyInitializer.java:162)
at
org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.pos tInstantiate(JavassistProxyFactory.java:66)
at
org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:269)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
at
org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:83)
[...]
Caused by: javassist.bytecode.DuplicateMemberException: duplicate
method: getType in sdedummy.FunctionalDesignElement_$$_javassist_0
at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.ja va:593)
at javassist.bytecode.ClassFile.addMethod(ClassFile.java:577)
at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java :658)
at
javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFacto ry.java:632)
at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:552 )
at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:335)

The error appears no matter what kind of inheritance mapping
(PersistenceOptions.INHERITANCE_MAPPING) is used.

Without using proxies, the error does not appear.

The problem must have to do with the two properties with the same name
(i.e. "type"). Renaming one of the properties makes the error go away. I
clueless why it is a problem that several subclasses have properties
with the same name.?

Thanks,
Frank
Re: [Teneo] Duplicate method exception for subclass properties with same name when using proxy class [message #491166 is a reply to message #491163] Tue, 13 October 2009 14:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Frank,
This seems indeed strange. Can you enter a bugzilla for this? It would be great if you have a small testmodel
reproducing this, if not then I can make my own ofcourse.

gr. Martin

Frank Grimm wrote:
> Dear newsgroup,
>
> Teneo (actually Hibernate's javassist) throws an
> javassist.bytecode.DuplicateMemberException (see below)
> when I use the following class hierarchy:
>
> * Class FunctionalDesignElement (abstract)
>
> * Class FunctionalParameter (superclass: FunctionalDesignElement)
> ** Attribute "type" : EString
>
> * Class FunctionInterfaceEnd (superclass: FunctionalDesignElement)
> ** Reference "type" : DataType (0..1; not contained)
>
> * Class DataType
>
> When I use Teneo's proxy mechanism (PersistenceOptions.SET_PROXY ==
> "true"), the following exception gets thrown by Javassist:
>
> 2364 [main] ERROR org.hibernate.proxy.pojo.BasicLazyInitializer -
> Javassist Enhancement failed: sdedummy.impl.FunctionalDesignElementImpl
> java.lang.RuntimeException: duplicate method: getType in
> sdedummy.FunctionalDesignElement_$$_javassist_0
> at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:344)
> at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory. java:314)
> at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.j ava:273)
> at
> org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer. getProxyFactory(JavassistLazyInitializer.java:162)
> at
> org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.pos tInstantiate(JavassistProxyFactory..java:66)
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:269)
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
> at
> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:83)
> [...]
> Caused by: javassist.bytecode.DuplicateMemberException: duplicate
> method: getType in sdedummy.FunctionalDesignElement_$$_javassist_0
> at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.ja va:593)
> at javassist.bytecode.ClassFile.addMethod(ClassFile.java:577)
> at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java :658)
> at
> javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFacto ry.java:632)
> at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:552 )
> at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:335)
>
> The error appears no matter what kind of inheritance mapping
> (PersistenceOptions.INHERITANCE_MAPPING) is used.
>
> Without using proxies, the error does not appear.
>
> The problem must have to do with the two properties with the same name
> (i.e. "type"). Renaming one of the properties makes the error go away. I
> clueless why it is a problem that several subclasses have properties
> with the same name.?
>
> Thanks,
> Frank


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Duplicate method exception for subclass properties with same name when using proxy class [message #491172 is a reply to message #491166] Tue, 13 October 2009 14:31 Go to previous messageGo to next message
Frank Grimm is currently offline Frank GrimmFriend
Messages: 22
Registered: July 2009
Junior Member
Dear Martin,

On 10/13/2009 04:07 PM, Martin Taal wrote:

> This seems indeed strange. Can you enter a bugzilla for this? It would
> be great if you have a small testmodel reproducing this, if not then I
> can make my own ofcourse.

Bug report can be found here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=292151

I'll add a sample Ecore model and my test code shortly.

Thanks,
Frank

> Frank Grimm wrote:
>> Dear newsgroup,
>>
>> Teneo (actually Hibernate's javassist) throws an
>> javassist.bytecode.DuplicateMemberException (see below)
>> when I use the following class hierarchy:
>>
>> * Class FunctionalDesignElement (abstract)
>>
>> * Class FunctionalParameter (superclass: FunctionalDesignElement)
>> ** Attribute "type" : EString
>>
>> * Class FunctionInterfaceEnd (superclass: FunctionalDesignElement)
>> ** Reference "type" : DataType (0..1; not contained)
>>
>> * Class DataType
>>
>> When I use Teneo's proxy mechanism (PersistenceOptions.SET_PROXY ==
>> "true"), the following exception gets thrown by Javassist:
>>
>> 2364 [main] ERROR org.hibernate.proxy.pojo.BasicLazyInitializer -
>> Javassist Enhancement failed: sdedummy.impl.FunctionalDesignElementImpl
>> java.lang.RuntimeException: duplicate method: getType in
>> sdedummy.FunctionalDesignElement_$$_javassist_0
>> at
>> javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:344)
>> at
>> javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory. java:314)
>> at
>> javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.j ava:273)
>> at
>> org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer. getProxyFactory(JavassistLazyInitializer.java:162)
>>
>> at
>> org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.pos tInstantiate(JavassistProxyFactory..java:66)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:269)
>>
>> at
>> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
>>
>> at
>> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:83)
>>
>> [...]
>> Caused by: javassist.bytecode.DuplicateMemberException: duplicate
>> method: getType in sdedummy.FunctionalDesignElement_$$_javassist_0
>> at
>> javassist.bytecode.ClassFile.testExistingMethod(ClassFile.ja va:593)
>> at javassist.bytecode.ClassFile.addMethod(ClassFile.java:577)
>> at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java :658)
>> at
>> javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFacto ry.java:632)
>> at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:552 )
>> at
>> javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:335)
>>
>> The error appears no matter what kind of inheritance mapping
>> (PersistenceOptions.INHERITANCE_MAPPING) is used.
>>
>> Without using proxies, the error does not appear.
>>
>> The problem must have to do with the two properties with the same name
>> (i.e. "type"). Renaming one of the properties makes the error go away. I
>> clueless why it is a problem that several subclasses have properties
>> with the same name.?
>>
>> Thanks,
>> Frank
>
>
Re: [Teneo] Duplicate method exception for subclass properties with same name when using proxy class [message #491179 is a reply to message #491172] Tue, 13 October 2009 14:43 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Thanks Frank, I have seen it, it will be a few days but if there is a solution then I will try to incorporate it in the
next build (a few days from now).

gr. Martin

Frank Grimm wrote:
> Dear Martin,
>
> On 10/13/2009 04:07 PM, Martin Taal wrote:
>
>> This seems indeed strange. Can you enter a bugzilla for this? It would
>> be great if you have a small testmodel reproducing this, if not then I
>> can make my own ofcourse.
>
> Bug report can be found here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=292151
>
> I'll add a sample Ecore model and my test code shortly.
>
> Thanks,
> Frank
>
>> Frank Grimm wrote:
>>> Dear newsgroup,
>>>
>>> Teneo (actually Hibernate's javassist) throws an
>>> javassist.bytecode.DuplicateMemberException (see below)
>>> when I use the following class hierarchy:
>>>
>>> * Class FunctionalDesignElement (abstract)
>>>
>>> * Class FunctionalParameter (superclass: FunctionalDesignElement)
>>> ** Attribute "type" : EString
>>>
>>> * Class FunctionInterfaceEnd (superclass: FunctionalDesignElement)
>>> ** Reference "type" : DataType (0..1; not contained)
>>>
>>> * Class DataType
>>>
>>> When I use Teneo's proxy mechanism (PersistenceOptions.SET_PROXY ==
>>> "true"), the following exception gets thrown by Javassist:
>>>
>>> 2364 [main] ERROR org.hibernate.proxy.pojo.BasicLazyInitializer -
>>> Javassist Enhancement failed: sdedummy.impl.FunctionalDesignElementImpl
>>> java.lang.RuntimeException: duplicate method: getType in
>>> sdedummy.FunctionalDesignElement_$$_javassist_0
>>> at
>>> javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:344)
>>> at
>>> javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory. java:314)
>>> at
>>> javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.j ava:273)
>>> at
>>> org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer. getProxyFactory(JavassistLazyInitializer.java:162)
>>>
>>> at
>>> org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.pos tInstantiate(JavassistProxyFactory..java:66)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.buildPr oxyFactory(EMFTuplizer.java:269)
>>>
>>> at
>>> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:151)
>>>
>>> at
>>> org.eclipse.emf.teneo.hibernate.tuplizer.EMFTuplizer.<init>(EMFTuplizer.java:83)
>>>
>>> [...]
>>> Caused by: javassist.bytecode.DuplicateMemberException: duplicate
>>> method: getType in sdedummy.FunctionalDesignElement_$$_javassist_0
>>> at
>>> javassist.bytecode.ClassFile.testExistingMethod(ClassFile.ja va:593)
>>> at javassist.bytecode.ClassFile.addMethod(ClassFile.java:577)
>>> at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java :658)
>>> at
>>> javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFacto ry.java:632)
>>> at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:552 )
>>> at
>>> javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory. java:335)
>>>
>>> The error appears no matter what kind of inheritance mapping
>>> (PersistenceOptions.INHERITANCE_MAPPING) is used.
>>>
>>> Without using proxies, the error does not appear.
>>>
>>> The problem must have to do with the two properties with the same name
>>> (i.e. "type"). Renaming one of the properties makes the error go away. I
>>> clueless why it is a problem that several subclasses have properties
>>> with the same name.?
>>>
>>> Thanks,
>>> Frank
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[CDO] Object locking on server
Next Topic:XMLLoad : How to prevent resolving XML entities
Goto Forum:
  


Current Time: Thu Apr 25 22:25:16 GMT 2024

Powered by FUDForum. Page generated in 0.17064 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top