Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-5452

PersistenceUnitBuilder cannot find persistence.xml on inPlace deployments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.4, 2.1.5, 2.1.6, 2.2
    • 2.1.7, 2.2.1
    • persistence
    • Security Level: public (Regular issues)
    • None
    • Linux. Tested on 2.1.4 and 2.1.5 release versions, but I'm sure it's the same in 2.2 and versions prior to 2.1.4.

    • Patch Available

    Description

      OpenJPA PersistenceUnitBuilder will fail to find persistence.xml files within modules of the EAR when using the inPlace deployment option. The following exception will be thrown during deployment:

      org.apache.geronimo.common.DeploymentException: Could not resolve reference at deploy time for query ?name=persistence/mydb#org.apache.geronimo.persistence.PersistenceUnitGBean. No GBeans found.

      Where mydb is the name of the persistence unit.

      I've attached a patch for the fix:

      — PersistenceUnitBuilder.java.orig 2010-07-14 20:26:55.991703857 -0500
      +++ PersistenceUnitBuilder.java 2010-07-17 16:22:22.786269319 -0500
      @@ -105,9 +105,16 @@
      // buildPersistenceUnits(persistence, module, module.getTargetPath());
      }
      try {

      • File rootBaseFile = module.getRootEarContext().getConfiguration().getConfigurationDir();
        + File rootBaseFile;
        + URI moduleBaseURI;
        + if(module.getRootEarContext().getConfigurationData().getInPlaceConfigurationDir() == null) { + rootBaseFile = module.getRootEarContext().getConfigurationData().getConfigurationDir(); + moduleBaseURI = moduleContext.getBaseDir().toURI(); + }

        else

        { + rootBaseFile = module.getRootEarContext().getConfigurationData().getInPlaceConfigurationDir(); + moduleBaseURI = moduleContext.getConfigurationData().getInPlaceConfigurationDir().toURI(); + }

        String rootBase = rootBaseFile.toURI().normalize().toString();

      • URI moduleBaseURI = moduleContext.getBaseDir().toURI();
        Map rootGeneralData = module.getRootEarContext().getGeneralData();
        ClassPathList manifestcp = (ClassPathList) module.getEarContext().getGeneralData().get(ClassPathList.class);
        if (manifestcp == null) {

      Attachments

        Activity

          People

            genspring Lin Quan Jiang
            rsumner Ryan Sumner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified