I fear that this is just another offshoot of
https://issues.apache.org/jira/browse/TOMEE-4485
Thomas Butz:
As for the additional details, the chain of events begins with a
singleton bean annotated with @Startup that sends messages to a JMS
topic.
Deferring the message sending (tested with a TimerService) seems to be
enough to avoid triggering the problem.
I can try to come up with a reproducer, but it is unlikely that I will
succeed, as our current stack is quite complex. However, please feel
free to ask any questions or tell me how I can provide the necessary
debug information.
Richard Zowalla:
Hi,
It seems that the information provided isn't sufficient to determine
the root cause.
Would you be able to share a reproducer or additional details?
Gruß
Richard
Am 21.07.2025 um 10:23 schrieb Thomas Butz <tb...@optitool.de.INVALID>:
Hi, I'm currently struggling with a potential bug in TomEE 10.1.0.
The problem seems to be triggered by the early injection of a
stateless EJB during server startup.
This results in a cascade of NPEs for subsequent stateless EJB
injections.
This is the first exception that can be observed during the startup
phase:
java.lang.NullPointerException: Cannot invoke
"org.apache.openejb.core.stateless.StatelessInstanceManager$Data.poolPop()"
because "data" is null
at
org.apache.openejb.core.stateless.StatelessInstanceManager.getInstance(StatelessInstanceManager.java:218)
~[?:?]
at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:204)
~[?:?]
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.synchronizedBusinessMethod(EjbObjectProxyHandler.java:265)
~[?:?]
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:260)
~[?:?]
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:89)
~[?:?]
at
org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:349)
~[?:?]
at jdk.proxy17/jdk.proxy17.$Proxy272.doMasterDataExport(Unknown
Source) ~[?:?]
at
de.optitool.bean.export.AsyncExportBean.handleMessage(AsyncExportBean.java:176)
~[?:?]
at
de.optitool.bean.export.AsyncExportBean.onMessage(AsyncExportBean.java:92)
~[?:?]
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:210)
~[?:?]
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:191)
~[?:?]
at
org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:191)
~[?:?]
at
org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:101)
~[?:?]
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:210)
~[?:?]
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:191)
~[?:?]
at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:95)
~[?:?]
at
org.apache.openejb.core.mdb.MdbContainer._invoke(MdbContainer.java:536)
~[?:?]
at
org.apache.openejb.core.mdb.MdbContainer.invoke(MdbContainer.java:510)
~[?:?]
at
org.apache.openejb.core.mdb.AbstractEndpointHandler.deliverMessage(AbstractEndpointHandler.java:115)
~[?:?]
at
org.apache.openejb.core.mdb.EndpointHandler.deliverMessage(EndpointHandler.java:28)
~[?:?]
at
org.apache.openejb.core.mdb.AbstractEndpointHandler.invoke(AbstractEndpointHandler.java:81)
~[?:?]
at
org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:28)
~[?:?]
at
de.optitool.bean.export.AsyncExportBean$$LocalBeanProxy.onMessage(de/optitool/bean/export/AsyncExportBean.java)
~[?:?]
at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.onMessage(MessageEndpointProxy.java:123)
~[?:?]
at
org.apache.activemq.ra.MessageEndpointProxy.onMessage(MessageEndpointProxy.java:64)
~[?:?]
at
org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:1056)
~[?:?]
at
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:170)
~[?:?]
at
org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:365)
~[?:?]
at
org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32)
~[?:?]
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
~[?:?]
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
The AsyncExportBean is a message-driven bean which tries to invoke
the "doMasterDataExport()" of a local stateless EJB injected with @EJB.
I quickly skimmed through the StatelessInstanceManager code, and it
doesn't seem to expect BeanContext.getContainerData() to return a
null value.
--
Mit freundlichen Grüßen / Best regards
Thomas Butz
_______________________________
OPTITOOL GmbH
Im Gewerbepark D 85
D - 93059 Regensburg
Phone: +49-941-59578-14