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

Datasource mapped in jboss-web.xml not available to persistence unit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 8.0.0.CR1
    • None
    • None
    • Workaround Exists
    • Hide

      Set wildfly.jpa.twophasebootstrap to false in the persistence unit definition as a workaround to have the persistence unit start as late as possible (during the INSTALL deployment phase):

      <property name="wildfly.jpa.twophasebootstrap" value="false"/>

      Show
      Set wildfly.jpa.twophasebootstrap to false in the persistence unit definition as a workaround to have the persistence unit start as late as possible (during the INSTALL deployment phase): <property name="wildfly.jpa.twophasebootstrap" value="false"/>

    Description

      I have mapped the datasource java:jboss/datasources/ExampleDS to jdbc/MyDS in jboss-web.xml for my application.

      In a stateless bean i can do a jndi lookup and find the datasource in both java:comp/env/jdbc/MyDS and java:module/env/jdbc/MyDS as expected. But if I try to use it in my persistence.xml I get an error:
      13:18:28,129 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description:

      {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"wfds-1.0-SNAPSHOT.war#wfdsPU\".__FIRST_PHASE__ is missing [jboss.naming.context.java.module.\"wfds-1.0-SNAPSHOT\".\"wfds-1.0-SNAPSHOT\".env.MyDS]"]}

      A minimal example application that demonstrates the problem is available at: https://github.com/umartin/wfds/

      Attachments

        Activity

          People

            Unassigned Unassigned
            martin_andersson Martin Andersson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: