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 D6804200BA3 for ; Thu, 20 Oct 2016 18:02:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D5497160AE0; Thu, 20 Oct 2016 16:02:47 +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 4E5FD160ACC for ; Thu, 20 Oct 2016 18:02:47 +0200 (CEST) Received: (qmail 15920 invoked by uid 500); 20 Oct 2016 16:02:46 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 15904 invoked by uid 99); 20 Oct 2016 16:02:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Oct 2016 16:02:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C51AAE008F; Thu, 20 Oct 2016 16:02:45 +0000 (UTC) From: reta To: dev@cxf.apache.org Reply-To: dev@cxf.apache.org References: In-Reply-To: Subject: [GitHub] cxf pull request #181: ensuring CDI Bean are always the CDI context ones Content-Type: text/plain Message-Id: <20161020160245.C51AAE008F@git1-us-west.apache.org> Date: Thu, 20 Oct 2016 16:02:45 +0000 (UTC) archived-at: Thu, 20 Oct 2016 16:02:48 -0000 Github user reta commented on a diff in the pull request: https://github.com/apache/cxf/pull/181#discussion_r84317452 --- Diff: integration/cdi/src/main/java/org/apache/cxf/cdi/JAXRSCdiResourceExtension.java --- @@ -74,16 +74,16 @@ featureBeans.add((Bean< ? extends Feature >)event.getBean()); } else if (CdiBusBean.CXF.equals(event.getBean().getName()) && Bus.class.isAssignableFrom(event.getBean().getBeanClass())) { - busBean = event.getBean(); + hasBus = true; } } public void load(@Observes final AfterDeploymentValidation event, final BeanManager beanManager) { + // no need of creational context, it only works for app scoped instances anyway + final Bean busBean = beanManager.resolve(beanManager.getBeans(CdiBusBean.CXF)); bus = (Bus)beanManager.getReference( --- End diff -- Thanks for the explanations, @rmannibucau. With that being said, the `load` method should not be trusted, as all the beans are taken from the `event`, which apparently do not come from `BeanManager`. Is my understanding correct? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---