Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10268

Adding external contexts breaks resolution of non-external on demand resources

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 7.1.0.DR18
    • 7.1.0.DR16
    • Naming
    • None
    • Workaround Exists
    • Hide

      Choose external context names that are lexicographically larger than the context you want to resolve.

      Show
      Choose external context names that are lexicographically larger than the context you want to resolve.

    Description

      The logic in ContextNames.BindInfo.setupLookupInjection(...) does not correctly establish dependencies for non-external context in the presence of external contexts.
      Take the resource: java:jboss/infinispan/cache/mycontainer/mycache
      The service registered under this name is installed on-demand. When no external contexts are defined, ExternalContexts.getParentExternalContext(...) returns null and the dependency is established correctly. However, when there are external contexts whose name is lexicographically larger than the external context, the ExternalContexts.getParentExternalContext(...) returns the ServiceName of the lexicographically smallest external context, i.e. the result of NavigableSet.lower(...), where the set contains the ServiceName of all external contexts. Therefore, if a user defines an external context with name "java:global/foo", a call to ContextNames.BindInfo.setupLookupInjection(...) for the jndi name above will establish a dependency on "java:global/foo" instead of the correct service name corresponding to the non-external context.

      Attachments

        Issue Links

          Activity

            People

              emartins@redhat.com Eduardo Martins
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: