[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] OneToOne AND ManyToOne Mapping works with FetchType.EAGER but not with FetchType.LAZY -> Exception when deploying (SGES 2.1)
|
This exception generally happens when our dynamic weaving is not working
properly. My knowledge of the issues related to getting this working on Spring
is limited, but I believe you need to run with a specific Agent that is provided
with the spring framework to allow it to work. Here is a post I found:
http://www.nabble.com/Weaving-in-Spring-problem-td20003299.html
If that is not helpful, you could try static weaving:
http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#Using_EclipseLink_JPA_Weaving
-Tom
Stefan Bley wrote:
Hi,
I have exactly the same problem in my application!
I use:
EclipseLink 1.0.2/1.1.0 (both fail)
Spring 2.5.6
Tomcat 6.0
The problem is here with the bi-directional @OneToOne(mappedBy="...")
mappings.
If I do not specify FetchType.LAZY then I get a StackOverflowError. I guess
this is because an EAGER fetch on both sides causes kind of recursion. So I
put a LAZY fetch on the entity that contains the mappedBy clause.
Now deployment to Tomcat is still working, but at runtime an exception is
thrown:
Exception [EclipseLink-60] (Eclipse Persistence Services -
1.1.0.r3639-SNAPSHOT):
org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_setrootFolder_vh] or
[_persistence_getrootFolder_vh] is not defined in the object
[com.example.domain.BackupDefinition].
Internal Exception: java.lang.NoSuchMethodException:
com.example.domain.BackupDefinition._persistence_getrootFolder_vh()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[rootFolder]
Descriptor: RelationalDescriptor(com.example.domain.BackupDefinition -->
[DatabaseTable(BACKUPDEFINITION)])
I debugged into EclipseLink (PrivilegedAccessHelper.findMethod(...)) and I
could see that this class BackupDefinition does not have any of these
_persistence_* methods. All other entity class do. Why is that?
Any idea how to fix this?
Stevy