Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-946

Persistence annotation processing is overly restrictive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.CR1
    • 7.0.0.Beta3
    • JPA / Hibernate
    • None

    Description

      If a deployment contains classes bearing the @PersistenceContext annotation, the annotation processor will fail the deployment if a persistence unit is not found. While this is correct for classes which are a target for container-driven injection, the application may contain annotated classes that are not injection targets according to the Java EE specification. This is not illegal according to the specification.

      To wit, a Spring application may use @PersistenceContext for performing Spring-driven injection of Spring-managed entity manager factories.
      In the past, such applications could have used the 'metadata-complete' attribute in web.xml, but this does not seem to work anymore.

      Regardless, of that, the server could adopt a more lenient approach, by failing the injection only when a managed bean is actually injected with a non-existent PU/PC reference.

      The other variant would be to restrict validation to classes which are actual injection targets according to the Java EE specification.

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              marius.bogoevici Marius Bogoevici (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: