openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thusitha Thilina Dayaratne <thusithathil...@gmail.com>
Subject NPE when webBeansContext.getApplicationBoundaryService() in AbstractProxyFactory openwebbeans 1.2.7
Date Tue, 19 May 2015 13:32:11 GMT
Hi,

I'm trying to upgrade tomee support in our server from tomee 1.6.0.3 to
1.7.2. Since 1.7.2 is not released yet I'm using 1.7.2-SNAPSHOT along with
the *openwebbeans 1.2.7*.
After doing the changes when I deploy an simple CDI app it throws following
exception (I deployed and run the same app with tomee 1.6.0.3 and *openwebbeans
1.2.1 *it works fine there)

ERROR {org.apache.catalina.core.StandardWrapperValve} -  Allocate exception
> for servlet HelloServlet
> java.lang.NullPointerException
> at
> org.apache.webbeans.proxy.AbstractProxyFactory.getProxyClassLoader(AbstractProxyFactory.java:81)
> at
> org.apache.webbeans.proxy.NormalScopeProxyFactory.createNormalScopeProxy(NormalScopeProxyFactory.java:122)
> at
> org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:732)
> at
> org.apache.webbeans.portable.ProducerMethodProducer.produce(ProducerMethodProducer.java:105)
> at
> org.apache.webbeans.portable.AbstractProducer.produce(AbstractProducer.java:182)
> at
> org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:121)
> at
> org.apache.webbeans.component.ProducerMethodBean.create(ProducerMethodBean.java:117)
> 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:754)
> at
> org.apache.webbeans.container.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:628)
> at
> org.apache.webbeans.inject.AbstractInjectable.inject(AbstractInjectable.java:95)
> at
> org.apache.webbeans.inject.InjectableField.doInjection(InjectableField.java:65)
> at
> org.apache.webbeans.portable.InjectionTargetImpl.injectFields(InjectionTargetImpl.java:208)
> at
> org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:194)
> at
> org.apache.webbeans.portable.InjectionTargetImpl.inject(InjectionTargetImpl.java:184)
> at
> org.apache.webbeans.component.AbstractOwbBean.create(AbstractOwbBean.java:125)
> at org.apache.openejb.core.WebContext.newInstance(WebContext.java:138)
> at
> org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:46)
> at
> org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:66)
> at
> org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:61)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
> at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:864)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:134)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
> at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
> at
> org.wso2.carbon.statistics.webapp.RequestIntercepterValve.invoke(RequestIntercepterValve.java:47)
> at
> org.wso2.carbon.bam.webapp.stat.publisher.WebAppStatisticPublisherValve.invoke(WebAppStatisticPublisherValve.java:104)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
> at
> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
> at
> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> at java.lang.Thread.run(Thread.java:745)


After some debugging the both versions I found out that NPE is get thrown
because ApplicationBoundaryService applicationBoundaryService in the
WebBeansContext is null.

The only possible place that I see where it get initialized is in the
overloaded constructor of the WebBeansContext.

In 1.2.1 NormalScopeProxyFactory.createNormalScopeProxy() method will get
the classloader from the first if clause as classLoader =
bean.getBeanClass().getClassLoader()

But in 1.2.7 it try to get classloader as classLoader =
getProxyClassLoader(bean.getBeanClass())
>From there NPE get thrown. I manually executed the 1.2.1 logic in debug
mode and then classloader get correctly.

Did I missed setting any configurations?
Can someone guide me on solving this?

Thanks
Best Regards

--

Mime
View raw message