Hi Tamas! Txs for the report, gonna look into it.
LieGrue, strub > Am 21.08.2018 um 22:09 schrieb Tamás Kimmel <[email protected]>: > > Hi! > > I work on an integration test to show if a CDI context is active on TomEE, > but there is something strange. > > On the first call to BeanManager.getContext(RequestScoped.class) I get a > ContextNotActiveException. > I think it is good, because I am out of request in a background thread. > > On the second call immediatelly after the first from the same thread I get an > active request context. According to this code from > org.apache.webbeans.web.context.WebContextsService during the first call a > request context is initialized, but not returned. > > public ServletRequestContext getRequestContext(boolean create) > { > ServletRequestContext requestContext = requestContexts.get(); > if (requestContext == null && create) > { > initRequestContext(null); > } > return requestContext; > } > > I am not sure what is the intended behaviour. > > Thanks in advance, > Kimmel Tamás
