Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5EDD610BD0 for ; Fri, 18 Oct 2013 21:12:23 +0000 (UTC) Received: (qmail 5923 invoked by uid 500); 18 Oct 2013 21:07:33 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 5859 invoked by uid 500); 18 Oct 2013 21:07:28 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 5839 invoked by uid 99); 18 Oct 2013 21:07:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 21:07:26 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lu4242@gmail.com designates 74.125.82.177 as permitted sender) Received: from [74.125.82.177] (HELO mail-we0-f177.google.com) (74.125.82.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 21:07:20 +0000 Received: by mail-we0-f177.google.com with SMTP id x55so4182233wes.8 for ; Fri, 18 Oct 2013 14:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=oOaCmZ6tjyObAj0H5iWr0luCPPd/ZMJ6DuROp80H1Tc=; b=WeUv76jh0zqSheI/f3/TInz306nOuxjbNpBbSsPuWehBUJsSd4kvs2c/ssZeeg3r76 GCLt96o4jMbVhileOa4NifAB2K0ysLrG82xZhGXPy18TTEXl/9OlwyUFEQsPTPRmr8jR lofjNSkPulKKjKaLW5kuCShU7Gv2USn7vDyubk6GRLInhspKYFta3s4RvmUgmVPkZrFm FMlsx/QmxFYh7pcXm4zZRwK2Klp3eBLGvQD6OFpCs2nVUDMaveA8WrLasaDAPKaBaXUg vzX/xPkrf1xcnCH+9VEvMKI54Y8WwDxliDuIaLC3yLZyXlExFCyhsar6puRh5kBlo2gp qpFQ== MIME-Version: 1.0 X-Received: by 10.180.9.134 with SMTP id z6mr943398wia.9.1382130419750; Fri, 18 Oct 2013 14:06:59 -0700 (PDT) Received: by 10.217.123.136 with HTTP; Fri, 18 Oct 2013 14:06:59 -0700 (PDT) In-Reply-To: References: Date: Fri, 18 Oct 2013 16:06:59 -0500 Message-ID: Subject: Re: [MyFaces 2.2] invoke @PreDestroy on (CDI) ViewScoped beans upon session expiration From: Leonardo Uribe To: MyFaces Discussion Content-Type: multipart/alternative; boundary=001a11c2b1beb3ddb704e90a505e X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2b1beb3ddb704e90a505e Content-Type: text/plain; charset=ISO-8859-1 Hi Howard It seems something failed in the build, but it was not in the code, it was like an interruption on jenkins. I have added the artifacts in: https://issues.apache.org/jira/browse/MYFACES-3747 https://issues.apache.org/jira/secure/attachment/12609208/myfaces-api-2.2.0-SNAPSHOT.jar https://issues.apache.org/jira/secure/attachment/12609209/myfaces-impl-2.2.0-SNAPSHOT.jar please try these artifacts. regards, Leonardo Uribe 2013/10/18 Howard W. Smith, Jr. > Leonardo, > > I see myfaces 2.2 api JAR was updated but not myfaces 2.2 impl JAR. Did you > want me to just download the following JAR and retest, or there is > another/later version of the JAR, which is yet to be built? > > myfaces-api-2.2.0-20131018.201520-2509.jar< > https://repository.apache.org/content/repositories/snapshots/org/apache/myfaces/core/myfaces-api/2.2.0-SNAPSHOT/myfaces-api-2.2.0-20131018.201520-2509.jar > > > > > thanks, > Howard > > On Fri, Oct 18, 2013 at 3:05 PM, Leonardo Uribe wrote: > > > Hi > > > > I have committed a mixed solution between @PreDestroy annotation and > > ManagedBeanDestroyerListener. The idea is the first one in destroy the > > beans wins and the second one is just ignored. I have tested it with both > > configurations, so I hope it will work in your application. > > > > Let us know what happen and thanks Howard for report this. This is the > kind > > of help that is very useful for the project in general. > > > > regards, > > > > Leonardo Uribe > > > > > > 2013/10/18 Leonardo Uribe > > > > > Hi > > > > > > I was able to reproduce the problem. I have been testing this issue > > > against jetty / weld, and this issue comes when using tomcat / owb > > > configuration. It seems when the session is destroyed, > > > CDIManagedBeanHandlerImpl try to get a reference of ViewScopeBeanHolder > > and > > > FlowScopeBeanHolder, but in that point of time the injection does not > > work > > > as you can expect and ViewScopeBeanHolder is recreated. > > > > > > This issue is becoming difficult ... > > > > > > regards, > > > > > > Leonardo Uribe > > > > > > > > > > > > 2013/10/18 Howard W. Smith, Jr. > > > > > > On Thu, Oct 17, 2013 at 9:04 PM, Howard W. Smith, Jr. < > > >> smithh032772@gmail.com> wrote: > > >> > > >> > OmniFaces CDI @ViewScoped[1] executes @PreDestroy on > > >> session.invalidate() > > >> > and that is what I like/expect, but MyFaces 2.2 CDI @ViewScoped > > >> > implementation is not doing the same. > > >> > > >> > > >> I am not trying to do any type of cross-forum posting. My goal is to > > >> communicate/share my actual/expected test results. > > >> > > >> In production, I am using TomEE 1.6.0 (OWB) + MyFaces 2.1.12 + > OmniFaces > > >> 1.6(.1) CDI @ViewScoped, which invokes @PreDestroy on session > > invalidation > > >> 'and' expiration. Some minutes ago, I did a test against production > app, > > >> and just wanted to show you my 'actual test results' of production > > (which) > > >> = 'expected test results' of MyFaces 2.2 CDI @ViewScoped. > > >> > > >> In production, session timeout = 15 minutes, so I did a test against > > >> production server, and did the 'same' test as Test 2 (session > > expiration) > > >> in my previous post that included my latest test and test results of > > >> MyFaces 2.2 CDI @ViewScoped. > > >> > > >> > > >> Test: login user, navigate to page which references CDI @ViewScoped > > bean, > > >> F5/refresh browser to generate another CDI @ViewScoped bean, and let > > >> session expire via (15-minute) session timeout; @PreDestroy of > > (OmniFaces) > > >> CDI @ViewScoped bean executed. see below. > > >> > > >> Oct 18, 2013 11:20:29 AM jsf.users.pf_UsersController loginUser > > >> INFO: administrator logged in at 10/18/2013 11:20 AM > > >> > > >> Oct 18, 2013 11:20:39 AM jsf.orders.OrderDocumentBean init > > >> INFO: jsf.orders.OrderDocumentBean@650707eb > > >> > > >> Oct 18, 2013 11:20:42 AM jsf.orders.OrderDocumentBean init > > >> INFO: jsf.orders.OrderDocumentBean@132f168a > > >> > > >> -- session expired -- > > >> > > >> Oct 18, 2013 11:35:43 AM jsf.orders.OrderDocumentBean releaseResources > > >> INFO: jsf.orders.OrderDocumentBean@132f168a > > >> > > >> Oct 18, 2013 11:35:43 AM jsf.orders.OrderDocumentBean releaseResources > > >> INFO: jsf.orders.OrderDocumentBean@650707eb > > >> > > >> Oct 18, 2013 11:35:43 AM jsf.users.pf_UsersController sessionTimeout > > >> INFO: administrator session ended at 10/18/2013 11:35 AM > > >> > > > > > > > > > --001a11c2b1beb3ddb704e90a505e--