yes, the exclusion is intended since the MF extension registers the beans already so no need to pay the scanning time.
Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://rmannibucau.metawerx.net/> | Old Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <https://www.packtpub.com/application-development/java-ee-8-high-performance> 2018-02-06 14:09 GMT+01:00 Thomas Andraschko <[email protected]>: > I mean that it should not fail because of duplicate beans therefore. > > > Am Dienstag, 6. Februar 2018 schrieb Thomas Andraschko : > >> 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-c >>> ore/src/main/java/org/apache/meecrowave/openwebbeans/KnowCla >>> ssesFilter.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 < >>> [email protected]> wrote: >>> >>> >>> Hi Dennis, >>> >>> can you check this diff https://gist.github.com/r >>> mannibucau/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.f >>> low.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 <https://twitter.com/rmannibucau> | Blog >>> <https://rmannibucau.metawerx.net/> | Old Blog >>> <http://rmannibucau.wordpress.com> | Github >>> <https://github.com/rmannibucau> | LinkedIn >>> <https://www.linkedin.com/in/rmannibucau> | Book >>> <https://www.packtpub.com/application-development/java-ee-8-high-performance> >>> >>> 2018-02-06 8:04 GMT+01:00 Dennis Kieselhorst <[email protected]>: >>> >>> 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 >>> <https://github.com/deki/myfaces-meecrowave-sample> >>> >>> Cheers >>> Dennis >>> >>> >>>
