myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Kildén <karl.kil...@gmail.com>
Subject ContextNotActive for @Model Predestroy trying to interact with @ViewScoped?
Date Tue, 27 Jan 2015 16:22:16 GMT
Hello,

Basically I was trying to get a hack in when I noticed that not all my
state was ViewScoped but rather RequestScoped. So I Created a new @Model
and injected my ViewScoped and in the predestroy i cleaned it...

This is not pretty but it would have served well as a temp fix.

I must ping my @Model of course:

<f:metadata>
<f:viewAction action="#{searchReset.ping}" onPostback="true"/>
</f:metadata>




SEVERE: Exception thrown while destroying bean instance : [SearchReset,
Name:searchReset, WebBeans Type:MANAGED, API
Types:[java.lang.Object,se.raindance.mp.search.SearchReset],
Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
java.lang.NullPointerException
at
org.apache.myfaces.cdi.view.ViewScopeContextImpl.isActive(ViewScopeContextImpl.java:123)
at
org.apache.webbeans.context.CustomPassivatingContextImpl.isActive(CustomPassivatingContextImpl.java:64)
at
org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:297)
at
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:88)
at
org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:70)
at
se.raindance.mp.search.SearchController$$OwbNormalScopeProxy0.reset(se/raindance/mp/search/SearchController.java)
at se.raindance.mp.search.SearchReset.reset(SearchReset.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.webbeans.intercept.LifecycleInterceptorInvocationContext.proceed(LifecycleInterceptorInvocationContext.java:103)
at
org.apache.webbeans.portable.InjectionTargetImpl.preDestroy(InjectionTargetImpl.java:335)
at
org.apache.webbeans.component.AbstractOwbBean.destroy(AbstractOwbBean.java:180)
at
org.apache.webbeans.context.AbstractContext.destroyInstance(AbstractContext.java:177)
at
org.apache.webbeans.context.AbstractContext.destroy(AbstractContext.java:202)
at
org.apache.webbeans.web.context.ServletRequestContext.destroy(ServletRequestContext.java:63)
at
org.apache.openejb.cdi.CdiAppContextsService.destroyRequestContext(CdiAppContextsService.java:279)
at
org.apache.openejb.cdi.CdiAppContextsService.endContext(CdiAppContextsService.java:161)
at
org.apache.openejb.server.httpd.EndWebBeansListener.requestDestroyed(EndWebBeansListener.java:125)
at
org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6189)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)


The ViewScoped bean is alive I have a breakpoint in the @PostConstruct so
it's weird imo

cheers

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message