| Summary: | NPE when using LAZY loading on ManyToOne relationship | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Daniel Le Berre <leberre> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | CLOSED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | christopher.delahunt | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Daniel Le Berre
Created attachment 187212 [details]
Test Case showing the bug
Please find enclosed a test case showing the problem.
I removed from the archive derby.jar, eclipselink.jar (2.1.2) and javax.persistence.2.0.1.jar. You will need to use your own copy of eclipselink and your own DB and change accordingly the persistence.xml file.
If the
@ManyToOne(fetch = FetchType.LAZY)
annotatation class B is changed into
@ManyToOne(fetch = FetchType.EAGER)
the test pass.
Problem is that the test is using the "eclipselink.weaving" proprety with a value="static" in the persistence.xml, but has not run the static weaver on the compiled classes. The eclipselink.weaving = static tells EclipseLink that weaving has been performed already, which causes a problem when it tries to use the _persistence_get_a_vh to access the valueholder for a lazy relationship. Please see http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Weaving for the options available for weaving which is required for lazy OneToOne and ManyToOne relationships. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |