[ 
https://issues.apache.org/jira/browse/TOMEE-4354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17861353#comment-17861353
 ] 

Richard Zowalla commented on TOMEE-4354:
----------------------------------------

I think the root cause here is, that the ManagedExecutorService now requires a 
ContextService to be present. The default context service is created via auto 
configuration, if referenced inside an application bean. Here is the 
chicken-egg issue (imho) because the managed executor service is created 
without an auto configuration event for the default context service, so the 
related jndi lookup is going into nothing (resulting in the exception) above. 
As a (first) workaround, you could try to configure a context service via 
tomee.xml and reference it via the "context" property.

> Fail to create ManagedExecutorService in TomEE 10.0.0-M1
> --------------------------------------------------------
>
>                 Key: TOMEE-4354
>                 URL: https://issues.apache.org/jira/browse/TOMEE-4354
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 10.0.0-M1
>         Environment: Ubuntu 24.04, OpenJDK 17
>            Reporter: cpliu
>            Priority: Major
>              Labels: executor, openejb
>
> In a fresh install of TomEE 10.0.0-M1-plume, I have in tomee.xml this 
> resource:
> {{<Resource id="Foo" type="ManagedExecutorService">
>   Core = 5
>   Max = 25
>   KeepAlive = 5 s
>   Queue = 15
>   ThreadFactory = org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
>   Lazy = true
> </Resource>}}
> TomEE failed to create the resource with error in catalina\{date}.log:
> {{25-Jun-2024 21:07:30.229 SEVERE [main] 
> jdk.internal.reflect.NativeMethodAccessorImpl.invoke Exception processing 
> global JNDI Resources
> org.apache.openejb.core.ivm.naming.LazyObjectReference$LazyNamingException: 
> Error calling instance factory method: public 
> org.apache.openejb.threads.impl.ManagedExecutorServiceImpl 
>  org.apache.openejb.resource.thread.ManagedExecutorServiceImplFactory.create()
>     at 
> org.apache.openejb.core.ivm.naming.LazyObjectReference.getObject(LazyObjectReference.java:39)
>  ...}}
> {{}}
> {{}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to