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 DCD1E10CAF for ; Tue, 8 Oct 2013 14:31:39 +0000 (UTC) Received: (qmail 61959 invoked by uid 500); 8 Oct 2013 14:31:37 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 61774 invoked by uid 500); 8 Oct 2013 14:31:37 -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 61766 invoked by uid 99); 8 Oct 2013 14:31:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 14:31:34 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of borisbroenner@gmail.com designates 209.85.160.54 as permitted sender) Received: from [209.85.160.54] (HELO mail-pb0-f54.google.com) (209.85.160.54) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 14:31:28 +0000 Received: by mail-pb0-f54.google.com with SMTP id ro12so8688789pbb.41 for ; Tue, 08 Oct 2013 07:31:06 -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=Vha8m2vQEvtxZ0yohp1hWp/t6CFnrdGX67UUDcusPoQ=; b=EQfX406VxXJRPjt7vcRL5QoEJNKCC6JyIUTiIjjAbNHZOYFezzLx9hjh175Ty7AzLr OOgYMr35T5GODMfrCcnuky37CZH6XDpNXC0nJQfX6Ry0h9RQGFvhcVAgzVl/fA2UJG6L q9ixYQ0Whgc45bbOMLnFPtss79fdxee11gNi7oafMylubZWVDo8rXM02w5ksAzIMkct6 +sBHUmlcHzNC/381a9kUrXEkD1r837ilcwbVOKNjB67eC/mp2w2KfnkxoD86gw61AFCo LpdoFD4peZkkQ/TbTCsJqBRFQ9mgg1epMmxeHzeqmh6UU+z8NIe+r77bTJO6ma6kI9Sf XnHw== MIME-Version: 1.0 X-Received: by 10.68.254.105 with SMTP id ah9mr2300030pbd.87.1381242666830; Tue, 08 Oct 2013 07:31:06 -0700 (PDT) Received: by 10.70.118.166 with HTTP; Tue, 8 Oct 2013 07:31:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Oct 2013 16:31:06 +0200 Message-ID: Subject: Re: CDI event propagation to ViewAccessScoped/ConversationScoped classes From: =?ISO-8859-1?Q?Boris_Br=F6nner?= To: MyFaces Discussion Content-Type: multipart/alternative; boundary=047d7b2e104381508704e83b9e71 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2e104381508704e83b9e71 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, On Tue, Oct 8, 2013 at 4:15 PM, Thomas Andraschko < andraschko.thomas@gmail.com> wrote: > Hi, > > did you already try to set the reception on the @Observers annotation? > Wow, I didn't know that at all. That worked! Thanks a lot :) Regards, Boris > > > > > 2013/10/8 Boris Br=F6nner > > > Hello, > > > > I have a database layer, that can be accessed by JSF and by REST. The > > backing beans for JSF are ViewAccessScoped. The services for REST are > > RequestScoped. > > > > When creating an entity, from both JSF or REST, an event should be rais= ed > > to notify all possible clients (JSF, but also other clients listening > e.g. > > JMS events). Now a problem occurs. When I create an entity using the RE= ST > > interface the event is raised as expected. > > > > However now WELD raises an ContextNotActiveException: > > > > org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active > > contexts for scope type > > > > > org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessS= coped > > > > I get the same problem when using the ConversationScoped annotation. Th= is > > problem occurs always when using the REST interface, i.e. whether or no= t > I > > have an JSF page open. > > > > > > Below you find a more detailed stack trace starting from the point wher= e > > the event is fired.It seems like Weld thinks there is such a bean, but = in > > the end then can't get a context. > > > > What can I do here? Does the CODI implementation even work in this > context? > > > > If you need more information about my setup, let me know :) > > > > Regards, > > Boris > > > > Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-00130= 3 > No > > active contexts for scope type > > > > > org.apache.myfaces.extensions.cdi.core.api.scope.conversation.Conversatio= nScoped > > at > > > org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:59= 8) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInst= ance.java:71) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.ja= va:79) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > de.dfki.asr.compass.ejb.project.OpenScenarioBean$Proxy$_$$_WeldClientProx= y.handleEntityCreated(OpenScenarioBean$Proxy$_$$_WeldClientProxy.java) > > [classes:] > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > [rt.jar:1.7.0_11] > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > [rt.jar:1.7.0_11] > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > [rt.jar:1.7.0_11] > > at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.7.0_11= ] > > at > > > > > org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflection= s.java:264) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectio= nAccess.java:52) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(Sec= ureReflectionAccess.java:137) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections= .java:260) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMetho= dImpl.java:170) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(Forward= ingWeldMethod.java:51) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecial= Value(MethodInjectionPoint.java:154) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java= :241) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java= :229) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:20= 7) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > > > org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.ja= va:569) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at > > > org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:564= ) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > at org.jboss.weld.event.EventImpl.fire(EventImpl.java:68) > > [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31] > > > --=20 M.Sc. Boris Br=F6nner Researcher Department Agents and Simulated Reality German Research Center for Artificial Intelligence (DFKI) Campus D 3.2, 66123 Saarbr=FCcken --047d7b2e104381508704e83b9e71--