You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Doychin (JIRA)" <ji...@apache.org> on 2019/01/11 19:11:00 UTC

[jira] [Created] (TOMEE-2454) During server stop not all Thread context listeners are properly removed

Doychin created TOMEE-2454:
------------------------------

             Summary: During server stop not all Thread context listeners are properly removed 
                 Key: TOMEE-2454
                 URL: https://issues.apache.org/jira/browse/TOMEE-2454
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
            Reporter: Doychin


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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)