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

@DataSourceDefinition defined data source can't be used in persistence.xml with CDI entity listeners

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not a Bug
    • Major
    • None
    • 8.0.0.CR1
    • EE, JPA / Hibernate
    • None
    • Hide

      I provided two test cases that demonstrate the issue for the Java EE samples project: https://github.com/javaee-samples/javaee7-samples/pull/188

      Running these will immediately reproduce the issue.

      Show
      I provided two test cases that demonstrate the issue for the Java EE samples project: https://github.com/javaee-samples/javaee7-samples/pull/188 Running these will immediately reproduce the issue.
    • Show
      see comment

    Description

      Defining a data source from within the application using either @DataSourceDefinition on a class or the data-source element in web.xml, and then using this in persistence.xml will cause a deployment failure.

      E.g.

      web.xml
      <data-source>
          <name>java:app/MyApp/MyDS</name>
          <class-name>org.h2.jdbcx.JdbcDataSource</class-name>
          <url>jdbc:h2:mem:test</url>
      </data-source>
      

      and

      persistence.xml
      <persistence-unit name="testPU">
          <jta-data-source>java:app/MyApp/MyDS</jta-data-source>
      </persistence-unit>
      

      will result in:

      ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "dca783dd-b383-4a16-85a4-1331a2f89354.war")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}
      
      ERROR [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "dca783dd-b383-4a16-85a4-1331a2f89354.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"dca783dd-b383-4a16-85a4-1331a2f89354.war#testPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.app.dca783dd-b383-4a16-85a4-1331a2f89354.MyApp.MyDS]"]}
      

      Attachments

        Issue Links

          Activity

            People

              smarlow1@redhat.com Scott Marlow
              arjan.tijms@gmail.com Arjan Tijms (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: