tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svetlin Zarev (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-2086) InitialContext.list() fails with NPE when called from EJB
Date Wed, 05 Jul 2017 08:04:00 GMT

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

Svetlin Zarev commented on TOMEE-2086:
--------------------------------------

I'm not familiar with TomEE's naming impl, so I'm not sure if my "solution" is OK, but a simple
check for "null" seems to fix it (IvmContext:586):

{code}
 final Object initiallyRequestedNodeObject = initiallyRequestedNode.getObject();
                if (null != initiallyRequestedNodeObject) {
....
{code}

> InitialContext.list() fails with NPE when called from EJB
> ---------------------------------------------------------
>
>                 Key: TOMEE-2086
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2086
>             Project: TomEE
>          Issue Type: Bug
>          Components: TomEE Core Server
>    Affects Versions: 7.0.4
>            Reporter: Svetlin Zarev
>         Attachments: sample.zip
>
>
> InitialContext.list() fails with NPE when called from EJB. The same works from servlet.
Attached application (with source) that reproduces the issue
> {code}
> ### Context: 
> java.lang.NullPointerException: while trying to invoke the method org.apache.openejb.core.ivm.naming.NameNode$Federation.iterator()
of a null object returned from java.lang.Class.cast(java.lang.Object)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.gatherNodes(IvmContext.java:586)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.addInListIfNeeded(IvmContext.java:608)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.gatherNodes(IvmContext.java:582)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.addInListIfNeeded(IvmContext.java:608)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.gatherNodes(IvmContext.java:582)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyNamingEnumeration.<init>(IvmContext.java:574)
> 	at org.apache.openejb.core.ivm.naming.IvmContext$MyListEnumeration.<init>(IvmContext.java:545)
> 	at org.apache.openejb.core.ivm.naming.IvmContext.list(IvmContext.java:381)
> 	at org.apache.openejb.core.ivm.naming.ContextWrapper.list(ContextWrapper.java:117)
> 	at org.apache.tomee.catalina.OpenEJBContext.list(OpenEJBContext.java:121)
> 	at org.apache.naming.SelectorContext.list(SelectorContext.java:359)
> 	at javax.naming.InitialContext.list(InitialContext.java:461)
> 	at org.example.TestServlet.listContext(TestServlet.java:48)
> 	at org.example.TestEJB.printContexts(TestEJB.java:14)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
> 	at org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
> 	at org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
> 	at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
> 	at org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
> 	at org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:252)
> 	at org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:212)
> 	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:347)
> 	at org.example.TestEJB$$LocalBeanProxy.printContexts(org/example/TestEJB.java)
> 	at org.example.TestServlet.doGet(TestServlet.java:27)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 	at org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
> 	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
> 	at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97)
> 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
> 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
> 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
> 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
> 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
> 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> 	at java.lang.Thread.run(Thread.java:805)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message