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

During server stop not all Thread context listeners are properly removed

    XMLWordPrintableJSON

Details

    Description

      When I tried to run some tests more then once using arquilian on second run non CDI tests failed the same way like in TOMEE-2448.

      Further investing the situation I found that because tests are run multiple times in the same JVM instance where server is stopped at the end of the first run and started again before second run.

      Because ThreadContext keeps listeners in a list on the second start another instances of listeners are added where these are not added in static initializers.

      So when non CDI app is started JSF (in this case) thinks it runs in CDI environment and tries to get instance of a service using BeanManger but the bean manager that is visible is from the previous run of the server and does not contain any beans.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Bondzhev Doychin Bondzhev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: