vranac
2018-07-02 08:44:33 UTC
When tried to inject:
@Context
javax.ws.rs.core.Application application;
inside class anotated with @javax.ws.rs.Path I get exception:
WARNING [http-nio-8080-exec-4]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor has
thrown exception, unwinding now
java.lang.NullPointerException
at
org.apache.openejb.core.ivm.naming.MapObjectReference.getObject(MapObjectReference.java:34)
at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:183)
at
org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:58)
at
org.apache.openejb.cdi.CdiResourceInjectionService.lookup(CdiResourceInjectionService.java:200)
at
org.apache.openejb.cdi.CdiResourceInjectionService.fillInjectionProperties(CdiResourceInjectionService.java:170)
at
org.apache.openejb.cdi.CdiResourceInjectionService.injectJavaEEResources(CdiResourceInjectionService.java:130)
at
org.apache.webbeans.portable.InjectionTargetImpl.injectResources(InjectionTargetImpl.java:278)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:209)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:205)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:196)
at
org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:126)
at org.apache.webbeans.component.ManagedBean.create(ManagedBean.java:67)
at
org.apache.webbeans.context.DependentContext.getInstance(DependentContext.java:68)
at
org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:125)
at
org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:799)
at
org.apache.openejb.server.cxf.rs.CdiResourceProvider$PseudoScopedCdiBeanCreator.create(CdiResourceProvider.java:286)
at
org.apache.openejb.server.cxf.rs.CdiResourceProvider.getInstance(CdiResourceProvider.java:173)
at
org.apache.cxf.jaxrs.JAXRSInvoker.getServiceObject(JAXRSInvoker.java:393)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:98)
at
org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
at
org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
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:650)
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:1457)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Tried on TomEE 7.0.4. *Other @Context injection working as expected.*
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
@Context
javax.ws.rs.core.Application application;
inside class anotated with @javax.ws.rs.Path I get exception:
WARNING [http-nio-8080-exec-4]
org.apache.cxf.phase.PhaseInterceptorChain.doDefaultLogging Interceptor has
thrown exception, unwinding now
java.lang.NullPointerException
at
org.apache.openejb.core.ivm.naming.MapObjectReference.getObject(MapObjectReference.java:34)
at
org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:183)
at
org.apache.openejb.core.ivm.ContextHandler.lookup(ContextHandler.java:58)
at
org.apache.openejb.cdi.CdiResourceInjectionService.lookup(CdiResourceInjectionService.java:200)
at
org.apache.openejb.cdi.CdiResourceInjectionService.fillInjectionProperties(CdiResourceInjectionService.java:170)
at
org.apache.openejb.cdi.CdiResourceInjectionService.injectJavaEEResources(CdiResourceInjectionService.java:130)
at
org.apache.webbeans.portable.InjectionTargetImpl.injectResources(InjectionTargetImpl.java:278)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:209)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:205)
at
org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:196)
at
org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:126)
at org.apache.webbeans.component.ManagedBean.create(ManagedBean.java:67)
at
org.apache.webbeans.context.DependentContext.getInstance(DependentContext.java:68)
at
org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:125)
at
org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:799)
at
org.apache.openejb.server.cxf.rs.CdiResourceProvider$PseudoScopedCdiBeanCreator.create(CdiResourceProvider.java:286)
at
org.apache.openejb.server.cxf.rs.CdiResourceProvider.getInstance(CdiResourceProvider.java:173)
at
org.apache.cxf.jaxrs.JAXRSInvoker.getServiceObject(JAXRSInvoker.java:393)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:98)
at
org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:68)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:253)
at
org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
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:650)
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:1457)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Tried on TomEE 7.0.4. *Other @Context injection working as expected.*
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html