Uploaded image for project: 'Jackrabbit FileVault'
  1. Jackrabbit FileVault
  2. JCRVLT-517

FSPackageRegistry.contains does not initialize packages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.4.10
    • 3.5.0
    • None
    • None

    Description

      The implementation of FSPackageRegistry.contains in the current implementation line 249  does just `return stateCache.containsKey(id);` without initializing the stateCache, as e.g. the method packages() (line 640) does. I strongly suggest that it should initialize the stateCache (that is, call loadPackageCache() ) if it wasn't initialized before returning.

      I stumbled over this because I'm using the Sling Feature Launcher and apply to org.apache.sling.jcr.packageinit triggered by org.apache.sling.extension.content to deploy content packages from the feature launcher, and this always fails since it says the packages aren't found. The reason for this is that org.apache.jackrabbit.vault.packaging.registry.impl.ExecutionPlanBuilderImpl.validate gets called, which uses FSPackageRegistry.contains, and this fails since the FSPackageRegistry isn't initialized yet.

      There is a workaround for this FSPackageRegistry problem by inserting a FSPackageRegistry.packages() call into ExecutionPlanRepoinitializer to initialize the FSPackageRegistry and throwing away the result, but I don't think this is the right way to solve this problem.  So I'm reporting this as a bug in org.apache.jackrabbit.vault .
      Thank you!

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              hanspeterstoerr Hans-Peter Stoerr
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: