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

Two persistence.xml in two EJB projects within one EAR don't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 9.0.0.Final
    • JPA / Hibernate
    • None
    • Hide

      We're now working around this by creating a new JAR in /lib which only contains the needed persistence.xml

      Show
      We're now working around this by creating a new JAR in /lib which only contains the needed persistence.xml

    Description

      We have an EAR containing a JAR in /lib and two EJBs and one WAR each referencing the JAR. The rest of the dependencies is: WAR->EJB1->EJB2.

      If each of the EJB JARs has its own persistence.xml the EAR cannot be deployed anymore to WildFly. (It worked on WebSphere)

      This works fine as long as no persistence.xml exists. As soon as each EJB gets its own persistence.xml (in our full project they point to different DSs) we're not able to deploy anymore.

      Wildfly doesn't seem to be able to resolve dependencies between modules as soon as there are two persistence.xml's. Despite the (repro) project doesn't even use it (yet). If you remove the persistence.xml's the project works fine. From the error (see below) it looks like the services defined in EJB1 try to use the persistence unit defined in EJB2 despite there not being any kind of reference.

      Repro on GitHub.
      Forum discussion here, including logs.

      Attachments

        Activity

          People

            smarlow1@redhat.com Scott Marlow
            hades32 Martin Rauscher (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: