You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Daniel Platz (Jira)" <de...@myfaces.apache.org> on 2021/07/12 15:14:00 UTC

[jira] [Created] (MYFACES-4407) "WELD-001303: No active contexts..." when MyFaces/JSF calls CDI/Weld on HTTP session cleanup

Daniel Platz created MYFACES-4407:
-------------------------------------

             Summary: "WELD-001303: No active contexts..." when MyFaces/JSF calls CDI/Weld on HTTP session cleanup
                 Key: MYFACES-4407
                 URL: https://issues.apache.org/jira/browse/MYFACES-4407
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.3.8
            Reporter: Daniel Platz


We see below exception when Jetty cleans expired HTTP sessions:
{code:java}
2021-07-06 22:32:30,016 WARN  [org.eclipse.jetty.server.session] (Session-HouseKeeper-4f4e375c-1): org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.SessionScoped
	at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647)
	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
	at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:164)
	at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131)
	at org.apache.myfaces.cdi.view.ViewScopeBeanHolder$Proxy$_$$_WeldClientProxy.destroyBeans(Unknown Source)
	at org.apache.myfaces.cdi.impl.CDIManagedBeanHandlerImpl.onSessionDestroyed(CDIManagedBeanHandlerImpl.java:113)
	at org.apache.myfaces.webapp.ManagedBeanDestroyerListener.sessionDestroyed(ManagedBeanDestroyerListener.java:201)
	at org.eclipse.jetty.server.session.SessionHandler$2.run(SessionHandler.java:312)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1520)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1539)
	at org.eclipse.jetty.server.session.SessionContext.run(SessionContext.java:92)
	at org.eclipse.jetty.server.session.SessionHandler.callSessionDestroyedListeners(SessionHandler.java:316)
	at org.eclipse.jetty.server.session.SessionHandler.invalidate(SessionHandler.java:1216)
	at org.eclipse.jetty.server.session.DefaultSessionIdManager.expireAll(DefaultSessionIdManager.java:436)
	at org.eclipse.jetty.server.session.SessionHandler.scavenge(SessionHandler.java:1267)
	at org.eclipse.jetty.server.session.HouseKeeper.scavenge(HouseKeeper.java:250)
	at org.eclipse.jetty.server.session.HouseKeeper$Runner.run(HouseKeeper.java:62)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
{code}
First analysis was already done by the Jetty guys: [https://github.com/eclipse/jetty.project/issues/6506]

I am facing the issue on jetty together with MyFaces 2.3.8 and Weld 3.1.5.Final. The jetty maintainers where able to reproduce this issue also on tomcat. So, it seems to be no issue with these specific version but maybe a general mismatch between weld and myfaces and the suggestion was to create an issue here and on myfaces to continue the discussion.

Weld issue: [https://issues.redhat.com/browse/WELD-2676]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)