Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-851

BundleTrackerCustomizer in BundleHookBundleTracker is called multiple times for the same event.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • JPA, Util
    • None
    • Linux-3.0.0, Karaf-3.0.0-SNAPSHOT with Felix, openjdk-6

    Description

      Steps to reproduce

      • Compile or get a karaf-3.0.0-SNAPSHOT and unpack it
      • Install openjpa-2.2.0 (using the attached feature-file)
      • Deploy a bundle containing a persistence-unit (attached jar for example)

      get the following Exception 4 times:

      ERROR: Bundle org.apache.aries.jpa.container [78] EventDispatcher: Error during dispatch. (java.lang.IllegalStateException: Unable to create persistence units for the bundle test.jpa.test.jpa.bundle/0.1.0.SNAPSHOT as previous persistence units already exist.)
      java.lang.IllegalStateException: Unable to create persistence units for the bundle test.jpa.test.jpa.bundle/0.1.0.SNAPSHOT as previous persistence units already exist.
      

      See attachment for full stacktrace

      In subsequent startups the Exception is still thrown but the stacktrace does not show in the console or the log.
      Also when using equinox the Stacktrace does not appear in either the console or the log ever, but it's still thrown.

      The problem is that the PersistenceBundleManager#addingBundle is called multiple times for the newly installed bundle.
      The PersistenceBundleManager is passed as a BundleTrackerCustomizer to a BundleHookBundleTracker.
      The BundleHookBundleTracker stores it in it's own private attribute and also passes it to it's super-constructor.
      So the customizer is stored in the instance twice.
      It's called by both BundleTracker$Tracked.customizerAdding and BundleHookBundleTracker$Tracked.customizerAdding.
      Both "Tracked" recognize the bundle as untracked and call the addingBundle-method.

      Attachments

        1. test.jpa.bundle-0.1.0-SNAPSHOT.jar
          6 kB
          Christoph Gritschenberger
        2. test.bundletracker.bundle-0.1.0-SNAPSHOT.jar
          5 kB
          Christoph Gritschenberger
        3. persistence-feature.xml
          1 kB
          Christoph Gritschenberger
        4. jpa-test-bundle-src.zip
          6 kB
          Christoph Gritschenberger
        5. bundletracker-test-src.zip
          6 kB
          Christoph Gritschenberger
        6. BundleHookBundleTracker-solution2.patch
          1 kB
          Christoph Gritschenberger
        7. BundleHookBundleTracker-solution1.patch
          1 kB
          Christoph Gritschenberger
        8. ARIES-851-stacktrace.TXT
          9 kB
          Christoph Gritschenberger
        9. ARIES-851-regression-fix.patch
          1 kB
          Christoph Gritschenberger

        Activity

          People

            gnodet Guillaume Nodet
            christophg Christoph Gritschenberger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: