Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-674

javaagent enhancer (PCEnhancerAgent) ignores persistence units after the first in persistence.xml

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0, 1.3.0
    • None
    • None

    Description

      A persistence.xml file has multiple PUs defined. A program makes use of a PU which is NOT the first PU in the list. The classes are not enhanced at build time, but are enhanced at runtime via the javaagent. No anchor arguments are passed to the javaagent.

      Because PCEnhancerAgent ignores PUs following the first, OpenJPA tries to use an appropriate runtime enhancing strategy for a class, but is not always be able to. The program gets this error back:

      Error Message: [Error while processing persistent field <blah>
      Error details: The accessor for field getTheAddress in type <blah> is private or package-visible. OpenJPA requires accessors in unenhanced instances to be public or protected. If you do not want to add such an accessor, you must run the OpenJPA enhancer after compilation, or deploy to an environment that supports deploy-time enhancement, such as a Java EE 5 application server.

      The root problem is that the javaagent choses only the first PU's classes for enhancement, and ignores the remaining PUs from persistence.xml. A workaround is to explicity specify the PU referenced by the program as an argument to the javaagent.

      Attachments

        1. PCEnhancerAgent.patch
          3 kB
          Dinkar Rao

        Activity

          People

            fancy Catalina Wei
            dinkar Dinkar Rao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: