Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 970FDC066 for ; Wed, 12 Nov 2014 17:35:34 +0000 (UTC) Received: (qmail 33396 invoked by uid 500); 12 Nov 2014 17:35:34 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 33349 invoked by uid 500); 12 Nov 2014 17:35:34 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 33324 invoked by uid 99); 12 Nov 2014 17:35:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2014 17:35:34 +0000 Date: Wed, 12 Nov 2014 17:35:33 +0000 (UTC) From: "Leonardo Uribe (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MYFACES-3940) FlowScopeBeanHolder calls ApplicationContextBean on PreDestroy MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MYFACES-3940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14208294#comment-14208294 ] Leonardo Uribe commented on MYFACES-3940: ----------------------------------------- It looks like an issue related to CDI, not to MyFaces, or at least I don't see a way to fix it from MyFaces side. If @PreDestroy is called, it is supposed that the context is still valid, and that context is controlled by CDI, not by MyFaces. The problem here is without servletContext you can't destroy the beans. > FlowScopeBeanHolder calls ApplicationContextBean on PreDestroy > -------------------------------------------------------------- > > Key: MYFACES-3940 > URL: https://issues.apache.org/jira/browse/MYFACES-3940 > Project: MyFaces Core > Issue Type: Bug > Components: JSR-344 > Affects Versions: 2.2.5 > Environment: WebSphere 8.5.5.3 > Reporter: Sami Korhonen > > Session scoped cdi bean FlowScopeBeanHolder relies on existance of ApplicationContextBean. However, when application is shutdown there is no guarantee that application scoped bean is destroyed after session scoped bean. Because ApplicationContextBean no longer exists, application server to throws an exception: > [10.11.2014 10:06:50:511 EET] 00000072 ManagedBean E ManagedBean error An error occurred while executing [@PreDestroy.] > javax.enterprise.context.ContextNotActiveException: WebBeans context with scope type annotation @ApplicationScoped does not exist within current thread > at org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:323) > at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:124) > at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.invoke(NormalScopedBeanInterceptorHandler.java:95) > at org.apache.myfaces.cdi.view.ApplicationContextBean_$$_javassist_28.getServletContext(ApplicationContextBean_$$_javassist_28.java) > at org.apache.myfaces.flow.cdi.FlowScopeBeanHolder.destroyBeansOnPreDestroy(FlowScopeBeanHolder.java:210) -- This message was sent by Atlassian JIRA (v6.3.4#6332)