Description
Christoph Mack opened DATAJPA-1250 and commented
I am currently working on a Spring Boot application using JPA with EclipseLink. After upgrading spring-boot-starter-parent
from 1.5.2 to 2.0.0.M7 and spring-data-commons
from 1.11.1 to 2.0.2 application startup fails with a NoSuchMethodError
for an entity class's _persistence_checkFetchedForSet
. This method is normally created by load-time weaving.
Looking at the order in which classes are loaded, it appears that some entity classes are loaded before the persistence unit and LTW is initialized.
It looks like the reason for this is that classes that appear as parameters of repository interfaces are now loaded when the repository bean definitions are created.
A minimal example to reproduce is https://github.com/spring-projects/spring-data-examples/tree/master/jpa/eclipselink with LTW enabled in Application::getVendorProperties
: The Customer
class gets loaded right after CustomerRepository
and EclipseLink's PersistenceWeaver
doesn't process it
Affects: 2.1 M1 (Lovelace), 2.0.2 (Kay SR2)
Attachments:
- DATAJPA-1250-not-working.zip (8.95 kB)
- DATAJPA-1250-working.zip (8.81 kB)
Issue Links:
- DATACMNS-1263 Allow configuration inspection-classloader customization
("depends on")
Referenced from: pull request #253
Backported to: 2.0.6 (Kay SR6)