Hi all,

I want to add some additional thoughts here:

The question is more or less a question related to the original design of the 
auto configuration of TomEE, so basically boils down to:

Should a default context service be created if implicitly referenced by a 
user-defined custom managed (or scheduled) executor service or not.
Nevertheless, the current behavior is odd, so the end user doesn’t actually 
know what is going on.

Regardless of which path we choose, we need to update the related documentation 
to state, that a context service is (now) needed. For people migrating from 
older version of TomEE, it would be more than neat to automatically create and 
configure the default context service to smooth transitions to TomEE 10. Wdyt?

Gruß
Richard

> Am 03.07.2024 um 12:57 schrieb Markus Jung <ju...@apache.org>:
> 
> Hey all,
> 
> 
> I've been investigating an issue a user reported with 10.0.0-M1 [1] with 
> Richard yesterday. The user configured a ManagedExecutorService Resource but 
> omitted configuring a ContextService (which is required in TomEE 10). This 
> causes the ManagedExecutorService to default to the "Default Context Service" 
> ContextService, which doesn't get configured automatically because it is not 
> injected anywhere. This leads to an ambiguous exception that "Default Context 
> Service" is unknown.
> 
> 
> If everything is configured (ManagedExecutorService + ContextService) and 
> linked together it works. If nothing is configured it works as well 
> (ContextService gets auto configured when ManagedExecutorService is auto 
> configured). However Configurations that were valid in TomEE 9 as the one 
> reported in [1] are now invalid.
> 
> 
> I'm not sure how this is actually intended to be used, documentation for 
> ManagedExecutorService is outdated as it doesn't mention the requirement of a 
> ContextService yet.
> 
> Should it work and the ContextService gets auto configured if not explicitly 
> configured? Or fail and tell the user in a more understandable way that 
> requirements have not been met?
> 
> 
> Thanks
> 
> Markus
> 
> 
> [1] https://issues.apache.org/jira/browse/TOMEE-4354
> 

Reply via email to