From user-return-1422-archive-asf-public=cust-asf.ponee.io@openwebbeans.apache.org Tue Feb 6 14:08:35 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 2158E180657 for ; Tue, 6 Feb 2018 14:08:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 110B6160C45; Tue, 6 Feb 2018 13:08:35 +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 09091160C3A for ; Tue, 6 Feb 2018 14:08:33 +0100 (CET) Received: (qmail 2054 invoked by uid 500); 6 Feb 2018 13:08:33 -0000 Mailing-List: contact user-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@openwebbeans.apache.org Delivered-To: mailing list user@openwebbeans.apache.org Received: (qmail 2044 invoked by uid 99); 6 Feb 2018 13:08:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2018 13:08:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id BFF90C00CF for ; Tue, 6 Feb 2018 13:08:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id BAI-At7J8Usd for ; Tue, 6 Feb 2018 13:08:29 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7F5275F216 for ; Tue, 6 Feb 2018 13:08:28 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id k19so2650459lfj.1 for ; Tue, 06 Feb 2018 05:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=p88nFeCrp3C1iuAVW9it1PoEicmgnSoMjgvyUsQQi6Q=; b=scp0IKa/7y3ghzpPBm4DmmtUlTsnM1UDgQQsjUASoDfBNUmZwc1kW1K/vtg8+l1GzV GOPTFkZj5Eds628Ql8uwI8u/gYMG8tbyzzzirAZsijfPEVmk7NBGH4XUbTWDbxRSIje5 uIuXs6QxfEdjoExGglWRhOqPNw0kFyU9NxHHdP6dhPRCq1xp8pqNIkGYuT95XCgnfxpx bWJanV4OnmHlexKe89+3JI3eOpKLZVFiIHKq3k/b3iBiw59Zm6wggIIqXS4fCDjZ4V9e ts9d6O0ODNzITC2eNk8CXk05mMa2+/dvkw7dZojYOsmn7YzAGPwoq7JWYk7UI9/ck3Xd eONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=p88nFeCrp3C1iuAVW9it1PoEicmgnSoMjgvyUsQQi6Q=; b=iq4iWtlN1NR5Os6PX3RzNlXp0ZG748V62zUBBcx2ldR4GYgCmTRmGBOPPBXfCJ5e0R Lg26TOG6tzhnnj7DcLBkPZSx5cfMWrV3HCjJ1ZTrtoGSIkzavwmc6WbTjL/eUHLARSf5 US2VSG2VNPNSGNZfV9ld18MIrT/SGYI1CuOl7GmHI7GhHegW1LZLa28zwvoOO5StzAE7 04nJAsEX1NONRcRwaC/RyE+RZ2iHTDeeeikwj8gewqe5u64L07UjFIgXJoNJU8BeilMt IL7hoCdXqWojYGnaZWL0rSRBLRaVJniI2d6Kwvv+S0Y/z2Zv1+2OlHEpbc1japc6JWAt lc4Q== X-Gm-Message-State: APf1xPAnhNS6PiWmc/GsMVwuoVIgaboUeeqCvZJxGWtS5EFrOx4f7Bbf +J1oXs/nv49bZSJj7CqEmPSL9XkhkZduAjKE9WwHOQ== X-Google-Smtp-Source: AH8x226IseB/jW2wUTpAxe//oXUnv02CEwLezssGFGSbCGOmxbgRN0ZEDM2Qak3y23OpCZ0d09ZLWTUH3tBlgPCuO3k= X-Received: by 10.46.71.81 with SMTP id u78mr1679717lja.35.1517922507747; Tue, 06 Feb 2018 05:08:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.34.134 with HTTP; Tue, 6 Feb 2018 05:08:26 -0800 (PST) In-Reply-To: <1111204416.4575204.1517922295352@mail.yahoo.com> References: <1111204416.4575204.1517922295352@mail.yahoo.com> From: Thomas Andraschko Date: Tue, 6 Feb 2018 14:08:26 +0100 Message-ID: Subject: Re: [meecrowave] run JSF MyFaces application To: "user@openwebbeans.apache.org" Content-Type: multipart/alternative; boundary="001a11410ba4def5c205648adf12" --001a11410ba4def5c205648adf12 Content-Type: text/plain; charset="UTF-8" AFAIR MyFaces should not be scannend and all beans are registered via a extension?! Also AFAIR it doenst even has a beans.xml. Am Dienstag, 6. Februar 2018 schrieb Mark Struberg : > Hi folks! > > I've debugged the example and it falls into the category 'bad luck' ;) > > Meecrowave has a specialised Filter KnowClassesFilter which by default > excludes some packages which are well known to not contain any CDI beans. > This is done to improve the startup time. > > There is kind of a positive/negative lookup logic. > https://github.com/apache/meecrowave/blob/trunk/ > meecrowave-core/src/main/java/org/apache/meecrowave/openwebbeans/ > KnowClassesFilter.java#L41 > > We have the 'included': if some class starts with any of those package > names, then we add it > If the class package does not show up in the included list then we look > into the 'excluded'. > And if we find it there, then we skip the whole class. > > Sadly 'org.apache.myfaces' is in this very 'excluded' list ... > And this is why Dennis' sample beans are not found. Any other project will > work perfectly fine. > > Do we like to make this configurable? > > Actually I think we do not even need this. It should only be used if you > create a single-jar packaging (uberjar). > Otherwise the 'bad' jars in question are already filtered out as a whole > anyway by the! > > > A quick hack would be to add a Filter and register it in > openwebbeans.properties. > That will of course trash the portability of your sample... > > LieGrue, > strub > > > On Tuesday, 6 February 2018, 09:24:15 CET, Romain Manni-Bucau < > rmannibucau@gmail.com> wrote: > > > Hi Dennis, > > can you check this diff https://gist.github.com/rmannibucau/ > c63afe1326ca9e7409735b3f5911ea45 ? > > I'm not sure why the bean is not found, is it a bad JSF setup? > > About the duplicate, it seems myfaces adds twice the same bean if you scan > it: once by scanning, once in the extension org.apache.myfaces.flow.cdi. > FlowBuilderCDIExtension#beforeBeanDiscovery. So long story > short org.apache.webbeans.config.BeansDeployer#addAdditionalAnnotatedTypes > ends up adding again the same beans. We can surely filter it in OWB but > also guess you should be able to make it working without scanning myfaces > at all, no? > > > > Romain Manni-Bucau > @rmannibucau | Blog > | Old Blog > | Github > | LinkedIn > | Book > > > 2018-02-06 8:04 GMT+01:00 Dennis Kieselhorst : > > Hi Romain, > > thanks for your feedback. Let's leave out Tobago, the demo needs to run in > several setups and is somehow complex. > > We are about to release MyFaces 2.3.0 and I'd like to create an archetype > for plain MyFaces and Meecrowave. Tried with a simple hello world sample > but still getting DuplicateDefinitionException. > > Can you please take a look? https://github.com/deki/ > myfaces-meecrowave-sample > > > Cheers > Dennis > > > --001a11410ba4def5c205648adf12 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable AFAIR MyFaces should not be scannend and all beans are registered via a ext= ension?! Also AFAIR it doenst even has a beans.xml.

Am Diensta= g, 6. Februar 2018 schrieb Mark Struberg :
Hi folks!

I've debugged t= he example and it falls into the category 'bad luck' ;)
<= br>
Meecrowave has a specialised Filter KnowClassesFilter which b= y default excludes some packages which are well known to not contain any CD= I beans. This is done to improve the startup time.

There is kind of a positive/negative lookup logic.
https://github.com/apache/meecrowave/blob/trunk/meecrowave= -core/src/main/java/org/apache/meecrowave/openwebbeans/KnowC= lassesFilter.java#L41

We have the 'included&= #39;: if some class starts with any of those package names, then we add it =
If the class package does not show up in the included list then = we look into the 'excluded'.
And if we find it there, the= n we skip the whole class.

Sadly 'org.ap= ache.myfaces' is in this very 'excluded' list ...
And= this is why Dennis' sample beans are not found. Any other project will= work perfectly fine.

Do we like to make this = configurable?

Actually I think we do not even need= this. It should only be used if you create a single-jar packaging (uberjar= ).
Otherwise the 'bad' jars in question are already filte= red out as a whole anyway by the!


A quick hack would be to add a Filter and register it in openwebbeans.pr= operties.
That will of course trash the portability of your samp= le...

LieGrue,
strub


=20
=20
On Tuesday, 6 February 2018, 09:24:15 CET, Romain M= anni-Bucau <r= mannibucau@gmail.com> wrote:


Hi Dennis,


I'm not sure why the bean is not found, is it a bad JSF set= up?

About the duplicate, it seems m= yfaces adds twice the same bean if you scan it: once by scanning, once in t= he extension=C2=A0org.apache.myfaces.flow.cdi.FlowBuilderCDIExten= sion#beforeBeanDiscovery. So long story short=C2=A0org.apache.webbeans= .config.BeansDeployer#addAdditionalAnnotatedTypes ends up adding = again the same beans. We can surely filter it in OWB but also guess you sho= uld be able to make it working without scanning myfaces at all, no?


=

Romain Manni-Bucau
@rmannibucau | =C2=A0Blog=C2=A0| Old Blog |=C2=A0Github=C2=A0| LinkedIn=C2=A0| Book

2018-02-06 8:04 GMT+01:00 Dennis Kieselhorst <deki@apache.org>:
Hi Romain,

thanks for your feedback. Let's leave out Tobago, the demo needs to run= in several setups and is somehow complex.

We are about to release MyFaces 2.3.0 and I'd like to create an archety= pe for plain MyFaces and Meecrowave. Tried with a simple hello world sample= but still getting DuplicateDefinitionException.

Can you please take a look? https://gi= thub.com/deki/ myfaces-meecrowave-sample

Cheers
Dennis


--001a11410ba4def5c205648adf12--