Skip to content

Entity classes loaded before EclipseLink LTW is initialized [DATAJPA-1250] #1585

Closed
@spring-projects-issues

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:

Issue Links:

  • DATACMNS-1263 Allow configuration inspection-classloader customization
    ("depends on")

Referenced from: pull request #253

Backported to: 2.0.6 (Kay SR6)

Metadata

Assignees

Labels

in: coreIssues in core supporttype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions