eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 145 forks source link

When SoteriaInitializer throwed NPE, InvocationManagerImpl caused ClassCastException #24169

Open dmatej opened 2 years ago

dmatej commented 2 years ago

Related is also line in StandardContext: 5296: iniInstance.onStartup(initializerList.get(initializer), ctxt); - catch block after it explains more.

In my opinion the ClassCast should not happen, so I have doubts the InvocationManagerImpl is thread-safe. Or it can have another cause I can't see, investigation required. After update of Soteria to 3.0.1 ejb_group_1 passed all tests, before the update one test failed (tests / ejb_group_1 / ejb_group_1.ejbclient. mainID, tests corba+ejb timer).

[2022-11-12T19:27:51.240370+01:00] [GlassFish 7.0] [SEVERE] [] [jakarta.enterprise.system.container.ejb.org.glassfish.ejb.security.application] [tid: _ThreadID=123 _ThreadName=p: thread-pool-1; w: 2] [levelValue: 1000] [[
Exception while running postInvoke for invType=EJB_INVOCATION and invocation=com.sun.enterprise.web.WebComponentInvocation@8fe206e
java.lang.ClassCastException: class com.sun.enterprise.web.WebComponentInvocation cannot be cast to class com.sun.ejb.EjbInvocation (com.sun.enterprise.web.WebComponentInvocation is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @1288b0ee; com.sun.ejb.EjbInvocation is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @97f1f8e)
at org.glassfish.ejb.security.application.EjbSecurityComponentInvocationHandler$1.afterPostInvoke(EjbSecurityComponentInvocationHandler.java:79)
at org.glassfish.api.invocation.InvocationManagerImpl.postInvoke(InvocationManagerImpl.java:218)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1791)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1772)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:180)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:91)
at com.sun.proxy.$Proxy277.callHello(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:122)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:152)
at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatchToServant(ServerRequestDispatcherImpl.java:501)
at com.sun.corba.ee.impl.protocol.ServerRequestDispatcherImpl.dispatch(ServerRequestDispatcherImpl.java:172)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequestRequest(MessageMediatorImpl.java:1529)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:1405)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleInput(MessageMediatorImpl.java:910)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:192)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.handleRequest(MessageMediatorImpl.java:674)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.dispatch(MessageMediatorImpl.java:476)
at com.sun.corba.ee.impl.protocol.MessageMediatorImpl.doWork(MessageMediatorImpl.java:2202)
at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:476)
at com.sun.corba.ee.impl.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:519)
]]
github-actions[bot] commented 1 year ago

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

github-actions[bot] commented 3 days ago

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment