Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 730CA200D2A for ; Sat, 28 Oct 2017 14:21:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7199D160BE1; Sat, 28 Oct 2017 12:21:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 92B4D1609D5 for ; Sat, 28 Oct 2017 14:21:04 +0200 (CEST) Received: (qmail 79206 invoked by uid 500); 28 Oct 2017 12:21:03 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 79197 invoked by uid 500); 28 Oct 2017 12:21:03 -0000 Delivered-To: apmail-openejb-commits@openejb.apache.org Received: (qmail 79193 invoked by uid 99); 28 Oct 2017 12:21:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Oct 2017 12:21:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 069501805E0 for ; Sat, 28 Oct 2017 12:21:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -97.889 X-Spam-Level: X-Spam-Status: No, score=-97.889 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URI_HEX=1.313, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id kimHIKIbv2zJ for ; Sat, 28 Oct 2017 12:21:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EEAAF5F1E7 for ; Sat, 28 Oct 2017 12:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 648A3E00A3 for ; Sat, 28 Oct 2017 12:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 11D2A212F5 for ; Sat, 28 Oct 2017 12:21:00 +0000 (UTC) Date: Sat, 28 Oct 2017 12:21:00 +0000 (UTC) From: "Martin Wiesner (JIRA)" To: commits@openejb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (TOMEE-2143) AbstractOwbBean.destroy(..) hits NPE in MyFaces 2.2.12 when cleaning up a user's Session and related "ViewScopeBeanHolder" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 28 Oct 2017 12:21:05 -0000 [ https://issues.apache.org/jira/browse/TOMEE-2143?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Wiesner updated TOMEE-2143: ---------------------------------- Environment: TomEE 7.0.4 (plus) MyFaces 2.2.12, Omnifaces 2.6.5 Shiro 1.3.2 Java 1.8.0-U151 (Oracle) MacOS 10.13 was: TomEE 7.0.4 (plus) MyFaces 2.2.12, Shiro 1.3.2 Java 1.8.0-U151 (Oracle) MacOS 10.13 > AbstractOwbBean.destroy(..) hits NPE in MyFaces 2.2.12 when cleaning up a user's Session and related "ViewScopeBeanHolder" > --------------------------------------------------------------------------------------------------------------------------- > > Key: TOMEE-2143 > URL: https://issues.apache.org/jira/browse/TOMEE-2143 > Project: TomEE > Issue Type: Bug > Components: TomEE Core Server > Affects Versions: 7.0.3, 7.0.4 > Environment: TomEE 7.0.4 (plus) > MyFaces 2.2.12, Omnifaces 2.6.5 > Shiro 1.3.2 > Java 1.8.0-U151 (Oracle) > MacOS 10.13 > Reporter: Martin Wiesner > > In an *EAR*-bundled application with several EJB jars and two WAR files, when I logout from my JSF-application via this piece of code here: > {code:java} > public void logout() throws IOException { > SecurityUtils.getSubject().logout(); > Faces.invalidateSession(); > Faces.redirect("login.xhtml"); > } > {code} > The moment the user session is invalidated, the redirect to the login screen is triggered sucessfully. However, I encounter the following stack trace within my standalone installation of TomEE plus (taken from catalina.out): > {code:java} > [http-nio-8080-exec-8] org.apache.webbeans.component.AbstractOwbBean.destroy Exception thrown while destroying bean instance : [ViewScopeBeanHolder, WebBeansType:MANAGED, Name:null, API Types:[org.apache.myfaces.cdi.view.ViewScopeBeanHolder,java.lang.Object,java.io.Serializable], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]] > java.lang.NullPointerException > at org.apache.myfaces.cdi.view.ViewScopeContextImpl.destroyAllActive(ViewScopeContextImpl.java:229) > at org.apache.myfaces.cdi.view.ViewScopeContextImpl.destroyAllActive(ViewScopeContextImpl.java:223) > at org.apache.myfaces.cdi.view.ViewScopeBeanHolder.destroyBeansOnPreDestroy(ViewScopeBeanHolder.java:221) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.apache.webbeans.intercept.LifecycleInterceptorInvocationContext.proceed(LifecycleInterceptorInvocationContext.java:103) > at org.apache.webbeans.portable.InjectionTargetImpl.preDestroy(InjectionTargetImpl.java:352) > at org.apache.webbeans.component.AbstractOwbBean.destroy(AbstractOwbBean.java:179) > at org.apache.webbeans.context.AbstractContext.destroyInstance(AbstractContext.java:206) > at org.apache.webbeans.context.AbstractContext.destroyInstance(AbstractContext.java:192) > at org.apache.webbeans.context.AbstractContext.destroy(AbstractContext.java:218) > at org.apache.webbeans.web.context.WebContextsService.destroyRequestContext(WebContextsService.java:408) > at org.apache.openejb.cdi.CdiAppContextsService.destroyRequestContext(CdiAppContextsService.java:113) > at org.apache.webbeans.web.context.WebContextsService.endContext(WebContextsService.java:223) > at org.apache.openejb.server.httpd.BeginWebBeansListener.requestDestroyed(BeginWebBeansListener.java:99) > at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:5974) > at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) > at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) > at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97) > at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) > at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) > at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) > at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) > at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) > at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457) > at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) > {code} > h3. Observations: > 1. Interestingly, this only appears with the EAR bundle. When started as a standalone WAR bundle from "webapps" folder or via the _tomee-maven-plugin_ the exceptions do not occur. > 2. A re-login can be conducted successfully. Yet, most request result in a 500 error as ViewScoped beans got errors such as: " javax.enterprise.context.ContextNotActiveException: WebBeans context with scope type annotation @SessionScoped does not exist within current thread" and the web-application becomes unusable... > 3. When using "Mojarra" instead of the pre-bundled (i.e., container-wide) MyFaces JSF implementation (in version 2.2.x or 2.3.x) it also does not occur, neither in EAR nor WAR use cases. > 4. Somehow, it seems to be a mix of OpenWebBeans, TomEE (EAR) and MyFaces problem... :-/ > I found this discussion, which seems pretty similar to what I observe here: > http://tomee-openejb.979440.n4.nabble.com/Intermittent-ViewScoped-Bean-Errors-td4680554.html > This thread discusses on observations made in TomEE 7.0.2. So, as there was no official fix/solution back then, I suspect other versions such as 7.0.2 and 7.0.3 might also be affected. I will confirm on this via comments. > Looking for a solution/fix for the EAR variant (like [~acornett] in the aforementioned thread) as this is production code which can't be broken into it's pieces. The problem/solution offered by him "Creating/modifying the session in JASPIC login code...." does not apply to my case, as I do not (willingly) modify the session on login code. > Any help much appreciated. -- This message was sent by Atlassian JIRA (v6.4.14#64029)