Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-8523

@Entity objects are not enhanced by the load time weaver in certain situations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.1 M2
    • Fix Version/s: 3.2 RC1
    • Component/s: Core, Data
    • Last commented by a User:
      true

      Description

      I've boiled down a confusing situation into a reproducible odd behavior in the attached example application. In an OpenJPA-supported application when there are two classes (an abstract parent and a concrete child) that are both marked with @Entity, the classes are not enhanced when an autowired @Repository DAO is called from a unit test. The DAO contains an inserted @PersistenceContext to get access to the EntityManager.

      If the call to the dao is commented out, the classes are enhanced as they should be.

      Using spring-instrument-3.1.M2.jar on a -javaagent line.

      Notes:

      • Run a mvn package with the dao call commented out and not commented out in the test class
      • Observe the difference in openjpa reporting the enhancement of classes vs. not enhancing them
      • It doesn't matter if you use a persistence.xml file or the new packagesToScan option in LocalContainerEntityManagerFactoryBean

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              attack7 Matt Young
              Last updater:
              Spring Issues Spring Issues
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 24 weeks, 4 days ago