Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-111254

Higher ranking ResourceBundleLoaders ignored by LanguageExtender

    Details

    • Fix Priority:
      4
    • Last Working Version:
    • What problem did the customer find?:
      LPP-37333

      Description

      When using Provide-Capability directives to register aggregating ResourceBundleLoader services, the service.ranking in the directive is incorrectly used by  ServiceTrackerResourceBundleLoader.

      Its internal ServiceTracker filters use the service.ranking to achieve an ordering, which is necessary. However this unfortunately has the side-effect of missing some ResourceBundleLoaders altogether. Specifically those with a higher service.ranking .

      By example, if you are have two directives as follows...

      liferay.resource.bundle;\ bundle.symbolic.name=A;\ resource.bundle.aggregate=(bundle.symbolic.name=A),(bundle.symbolic.name=B);\ service.ranking=1;\ servlet.context.name=some-context
      liferay.resource.bundle;\ bundle.symbolic.name=B;\ resource.bundle.aggregate=(bundle.symbolic.name=C),(bundle.symbolic.name=B);\ service.ranking=2

      ... then attempt to retrieve a language key through obtaining a ResourceBundleLoader as follows ...

      ResourceBundleLoaderUtil.ResourceBundleLoaderUtil.getResourceBundleLoaderByServletContextName("some-context"

      .... then it would actually not consider keys in module C.

      I have attached an integration test which can be used to verify the fix.  Please note that the regression is likely to surface in 7.2.x also if/when LPS-110482 is backported.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              team-core-infra Product Team Core Infrastructure
              Reporter:
              stian.sigvartsen Stian Sigvartsen
              Participants of an Issue:
              Recent user:
              Sophia Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Days since last comment:
                37 weeks, 5 days ago

                  Packages

                  Version Package