[
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)
|
Stefan, Zebhed, Dave,
To add to the discussion.
For dynamic weaving in Glassfish or WebLogic (there is now a known
issue with war/ejb module precedence in application.xml for some types
of applications).
Try changing the order of your modules in application.xml in your
EAR as in some cases (a JSF managed-bean element with an @EJB injection
for example is one case) the jar containing an injected
PersistenceContext (usually a SSB in an ejb.jar) must be loaded first
(where it is weaved/instrumented) before any WAR or other ejb.jar module
that injects the SSB that contains the persistence unit.
See bug # 323148 for GlassFish and WebLogic in this case - if it
helps your situation we have posted nearly identical EARs and Eclipse
projects that show a case that fails with the NPE and one that does not.
http://bugs.eclipse.org/323148
The NullPointerException in this case is thrown by the JVM itself
instead of a MethodNotFound Exception when trying to run a weaving
function of the form _*_vh.
We will add a better root cause warning about the EE module
processing order that causes this issue.
thank you
/michael
Tom Ware wrote:
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
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users