Enabling runtime bytecode enhancement breaks resolution of datasource alias in JBoss EAP

Solution Verified - Updated -

Issue

  • Defined datasource alias in application.xml

        ...
        <resource-ref>
            <res-ref-name>testDS</res-ref-name>
            <lookup-name>java:jboss/datasources/ExampleDS</lookup-name>
        </resource-ref>
        ...
    
  • Enabled bytecode enhancement in persistence.xml

                <property name="hibernate.enhancer.enableLazyInitialization" value="true" />
                <property name="hibernate.enhancer.enableAssociationManagement" value="true" />
    
  • Deployment fails with

    ... ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jboss.eap-1.0-SNAPSHOT.ear")]) - failure description: {
        "WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.app.ejb-application.env.testDS"],
        "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"jboss.eap-1.0-SNAPSHOT.ear/ejb.jar#jboss-eap-hibernate\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.ejb-application.env.testDS]"]
    }
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Hibernate 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content