Hi Romain,

thank you, it helps a bit to understand.

I would be ok, if meecrowave would handle everything as expected, but somehow 
my src/test/resources/META-INF/beans.xml is completely ignored in the case that 
both are in the classpath. Maybe we should at least fix that.

And - I cannot use SeContainerInitializer with meecrowave (without owb-se), 
because the META-INF/services-file is missing in meecrowave-core.

Is that intended?


Cheers,

Arne


--

Arne Limburg - Enterprise Architekt




OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limb...@openknowledge.de
www.openknowledge.de <https://www.openknowledge.de/>

Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:

Zu unseren Events<https://www.openknowledge.de/event/>





________________________________
Von: Romain Manni-Bucau <rmannibu...@gmail.com>
Gesendet: Donnerstag, 18. Februar 2021 17:11
An: openwebbeans-dev
Betreff: Re: Incompatibility between owb-se and meecrowave?

Hi Arne,

Both (meecrowave-core and owb-se) implement SeContainer API - this part is
intended.

Nominal case is to have only one of both in the classpath.

The main trick happens
in org.apache.openwebbeans.se.SeInitializerFacade#SeInitializerFacade (and
when you have both meecrowave wins since it supports SE + other features).

If you handle the bootstrap manually you can do
new org.apache.openwebbeans.se.OWBInitializer() to workaround it - sadly
SeContainerInitializer does not have a provider(fqn) method not supports a
system property to override it.
If in a maven project and for tests I suspect you can just implement your
own org.apache.openwebbeans.se.SeInitializerFacade and since maven will put
src/test/resources before deps in the classpath it will use that so you can
control the selection logic.

If not sufficient we can still
extend org.apache.openwebbeans.se.SeInitializerFacade#SeInitializerFacade
logic to read a system property to select the container to use and if not
fallback on current impl, we can even enrich our junit5 integration (@Cdi)
to set this system property around
org/apache/openwebbeans/junit5/internal/CdiExtension.java:70 to ensure we
can set it in the annotation if relevant.

Hope it helps a bit.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2frmannibucau.metawerx.net&umid=b33097f3-3ba5-4d1d-a944-8f469aed22f4&auth=ab2dbe9a65917e05515ec2a89459f3e450df8ff8-5387e0b08aca5d54f73dd04264c823e22f121630>
 | Old Blog
<https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=http%3a%2f%2frmannibucau.wordpress.com&umid=b33097f3-3ba5-4d1d-a944-8f469aed22f4&auth=ab2dbe9a65917e05515ec2a89459f3e450df8ff8-630e11efd26521ab597721a159776f15faf70734>
 | Github 
<https://smex-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fgithub.com%2frmannibucau&umid=b33097f3-3ba5-4d1d-a944-8f469aed22f4&auth=ab2dbe9a65917e05515ec2a89459f3e450df8ff8-e8183cb0b6e5f912faccf35291165d1fbbd68331>
 |
[https://secure.gravatar.com/blavatar/18ef8a5fe8eefd3810b5e9743904d82c?s=200&ts=1613679711]<https://smex-ctp.trendmicro.com/wis/clicktime/v1/query?url=http%3a%2f%2frmannibucau.wordpress.com&umid=b33097f3-3ba5-4d1d-a944-8f469aed22f4&auth=ab2dbe9a65917e05515ec2a89459f3e450df8ff8-630e11efd26521ab597721a159776f15faf70734>

New posts here >>> rmannibucau.metawerx.net | New posts here >>> 
https://rmannibucau.metawerx.net<https://smex-ctp.trendmicro.com/wis/clicktime/v1/query?url=http%3a%2f%2frmannibucau.wordpress.com&umid=b33097f3-3ba5-4d1d-a944-8f469aed22f4&auth=ab2dbe9a65917e05515ec2a89459f3e450df8ff8-630e11efd26521ab597721a159776f15faf70734>
smex-ctp.trendmicro.com
New posts here >>> https://rmannibucau.metawerx.net


LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
[https://static.packt-cdn.com/products/9781788473064/cover/smaller]<https://www.packtpub.com/application-development/java-ee-8-high-performance>

Java EE 8 High Performance | 
Packt<https://www.packtpub.com/application-development/java-ee-8-high-performance>
www.packtpub.com
Get more control of your applications performances in development and 
production and know how to meet your Service Level Agreement on critical 
microservices.




Le jeu. 18 févr. 2021 à 16:46, Arne Limburg <arne.limb...@openknowledge.de>
a écrit :

> Hi,
>
>
> I am observing some issues with
>
> SeContainerInitializer.newInstance().initialize();
>
> When I use it in my tests meecrowave (which is on the classpath) kicks in
> and does some weird stuff with the classpath.
>
> Basically I try to enable an alternative stereotype for my tests and it
> does not work in that scenario neither via beans.xml (in
> src/test/resources/META-INF) nor via
> SeContainerInitializer#selectAlternativeStereotypes.
>
> With either owb-se or meecrowave in the classpath it works as expected
> (with new Meecrowave().bake()).
>
>
> Did a short digging into the code and it seams that two contexts are
> started in that case.
>
>
> Does anyone have an idea what's going on or where I should look at to find
> the problem?
>
> Next question: How is it supposed to work?
>
> In my scenario I want to start a CDI container without a webcontainer, but
> even doing it with owb-internal classes does not work, because it detects
> some meecrowave classes that have servlet injection points that cannot be
> satisfied in that scenario.
>
>
> Imho when using SeContainerInitializer.newInstance().initialize()
> meecrowave should not be started, but I have no idea how to achieve that.
> Should we explicitly exclude every meecrowave class in SE scenarios?
>
>
> I would work on that, but I need an idea in which direction to go.
>
>
> Cheers,
>
> Arne
>
>
> --
>
> Arne Limburg - Enterprise Architekt
>
>
> OPEN KNOWLEDGE GmbH
> Poststraße 1, 26122 Oldenburg
> Mobil: +49 151 - 108 22 942
> Tel: +49 441 - 4082-154
> Fax: +49 441 - 4082-111
> arne.limb...@openknowledge.de
> www.openknowledge.de<http://www.openknowledge.de> 
> <https://www.openknowledge.de/>
>
> Registergericht: Amtsgericht Oldenburg, HRB 4670
> Geschäftsführer: Lars Röwekamp, Jens Schumann
>
> Treffen Sie uns auf kommenden Konferenzen und Workshops:
>
> Zu unseren Events<https://www.openknowledge.de/event/>
>
>
>
>
>

Reply via email to