Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2087

IvmContext.list() does not correctly list the context content

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 7.0.4
    • None
    • None
    • Important

    Description

      MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" it with the wrong NameNode).

      Another issue is with MyNamingEnumeration.isMyChild() which considers entries that are NOT children to the "parent" tree as such

      One more issue is that the wrong parentNode is passed as argument to gatherNodes in case we are listing the context for any "IvmContext != this"

      To give an example:

      Expected context content:

      ### Context: /module
      Name: TestEJB!org.example.TestEJB	Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup	[looking up: TestEJB!org.example.TestEJB]	[Value]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      Name: TestEJB	Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup	[looking up: TestEJB]	[Value]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      Name: ModuleName	Class=java.lang.String	[looking up: ModuleName]	[Value]: 
      Name: env	Class=org.apache.naming.NamingContext	[looking up: env]	[Value]: org.apache.naming.NamingContext@1bb2d0a8
      
      
      ### Context: /module/env
      Name: name	Class=java.lang.String	[looking up: name]	[Value]: module-env
      

      Actual context content:

      
      ### Context: /module
      Name: global	Class=org.apache.openejb.core.ivm.naming.IvmContext	[looking up: global]	> Failed to lookup: global
      Name: dummy	Class=java.lang.String	[looking up: dummy]	> Failed to lookup: dummy
      Name: TestEJB!org.example.TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB!org.example.TestEJB]	[Reference]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      Name: TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB]	[Reference]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      Name: ModuleName	Class=java.lang.String	[looking up: ModuleName]	[Value]: 
      Name: env	Class=org.apache.openejb.core.ivm.naming.IvmContext	[looking up: env]	[Value]: IvmContext{mynode=}
      Name: TestEJB!org.example.TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB!org.example.TestEJB]	[Reference]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      Name: TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB]	[Reference]: proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
      
      
      ### Context: /module/env
      Name: TestEJB!org.example.TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB!org.example.TestEJB]	> Failed to lookup: TestEJB!org.example.TestEJB
      Name: TestEJB	Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference	[looking up: TestEJB]	> Failed to lookup: TestEJB
      Name: name	Class=java.lang.String	[looking up: name]	[Value]: module-env
      

      Note the "failed too lookup..." messages - these are all objects that MUST NOT be listed as part of that context.

      I'm attaching an application that reproduces the issue.

      Requesting it like "http://localhost:8080/?ejb" will print tomee's naming tree
      Requesting it like "http://localhost:8080" will print tomcat's naming tree

      Attachments

        1. sample.zip
          22 kB
          Svetlin Zarev

        Issue Links

          Activity

            People

              Unassigned Unassigned
              SvetlinZarev Svetlin Zarev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: