Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-20521

Cannot use CDI with Jakarta Persistence + application defined datasources without explicitly disabling byte code enahacement

XMLWordPrintable

    • Hide

      Clone the https://github.com/resteasy/resteasy-examples repository.

      cd resteasy-examples/contacts
      mvn clean wildfly:dev
      

      You should see an INFO level message like:

      12:43:27,346 INFO  [org.hibernate.orm.beans] (ServerService Thread Pool -- 42) HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
      
      Show
      Clone the https://github.com/resteasy/resteasy-examples repository. cd resteasy-examples/contacts mvn clean wildfly:dev You should see an INFO level message like: 12:43:27,346 INFO [org.hibernate.orm.beans] (ServerService Thread Pool -- 42) HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader .
    • ---
    • ---

      In WildFly when byte code enhancement is explicitly turned on, setting jboss.as.jpa.classtransformer to true (with an application datasource/default datasource), CDI is explicitly disabled. This means that you cannot inject fields or parameters into Jakarta Persistence resources like callbacks, e.g. @PostPersist. The reason why this is the case is described in WFLY-1463.

      The default was changed from false to true in WFLY-19393. We need to revert the behavior back to disabling the byte code enhancement by default.

              smarlow1@redhat.com Scott Marlow
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: