You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by Thomas Frühbeck <t....@gmail.com> on 2024/03/10 13:49:18 UTC

DS-2.0.0 - Wildfly - BeanMangerDelegate - subdeployment reverse bean visibilty issue

We have already discussed the problem of interceptorLookup for PartialBean
on Wildfly.
IMHO due to subdeployment CL-visibilty issues (not flat!) the interceptors
in jar A are not visible in jar DS-partial-bean-impl.

A possible solution for this can be:
BeanMangerProvider#getBeanManager(): extend decision on lookup strategy like
    private static boolean useDelegateLookup()
    {
        return CoreBaseConfig.BeanManagerIntegration.DELEGATE_LOOKUP
                && System.getProperty("jboss.server.name") == null;
    }

Then all tests in partial-bean-impl -P wildfly-build-managed run
successfully!

Another issue that could be resolved this way: TransactionStrategy lookup
in data-impl:
Instead of @Priority workaround
  - activate ContainerMangedTxStrategy in beans.xml
  - and change Injection of TransactionStrategy in TransactionalQueryRunner
like:
    protected Object executeTransactional(final QueryBuilder builder, final
CdiQueryInvocationContext context)
    {
        TransactionStrategy strategy =
BeanProvider.getContextualReference(TransactionStrategy.class);

will also work fine!

Just to show the massive impact of the identified (supposed?) bug in
Wildfly subdeployment class visibility.

First step: your feedback on the proposed (temporary?) fix on
abovementioned change in BeanManagerLookup
:-/

Re: DS-2.0.0 - Wildfly - BeanMangerDelegate - subdeployment reverse bean visibilty issue

Posted by Thomas Frühbeck <t....@gmail.com>.
I to not object, this boils down to using "
deltaspike.bean-manager.delegate_lookup" for Wildfly?
I will set the configuration to "deltaspike.bean-manager.delegate_lookup"
for wildfly-managed profiles as a first step - to finally see tests working.
thanks

Am Mo., 18. März 2024 um 09:21 Uhr schrieb Thomas Andraschko <
andraschko.thomas@gmail.com>:

> Can we just set this property based on the profiles for our tests?
> This is probably also required for payara users, we have to add it to the
> docs then of course.
>
> Am So., 10. März 2024 um 14:49 Uhr schrieb Thomas Frühbeck <
> t.fruehbeck@gmail.com>:
>
> > We have already discussed the problem of interceptorLookup for
> PartialBean
> > on Wildfly.
> > IMHO due to subdeployment CL-visibilty issues (not flat!) the
> interceptors
> > in jar A are not visible in jar DS-partial-bean-impl.
> >
> > A possible solution for this can be:
> > BeanMangerProvider#getBeanManager(): extend decision on lookup strategy
> > like
> >     private static boolean useDelegateLookup()
> >     {
> >         return CoreBaseConfig.BeanManagerIntegration.DELEGATE_LOOKUP
> >                 && System.getProperty("jboss.server.name") == null;
> >     }
>
>

Re: DS-2.0.0 - Wildfly - BeanMangerDelegate - subdeployment reverse bean visibilty issue

Posted by Romain Manni-Bucau <rm...@gmail.com>.
+1 to explicitly set the property in the profile since it has some negative
perf impacts and the system property can not be sufficient - until we also
check the actual env.

Can also mean we lookup the beans less often at runtime and more in
postconstructs or just use plain injects (don't recall why it was not the
case).

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>


Le lun. 18 mars 2024 à 09:21, Thomas Andraschko <an...@gmail.com>
a écrit :

> Can we just set this property based on the profiles for our tests?
> This is probably also required for payara users, we have to add it to the
> docs then of course.
>
> Am So., 10. März 2024 um 14:49 Uhr schrieb Thomas Frühbeck <
> t.fruehbeck@gmail.com>:
>
> > We have already discussed the problem of interceptorLookup for
> PartialBean
> > on Wildfly.
> > IMHO due to subdeployment CL-visibilty issues (not flat!) the
> interceptors
> > in jar A are not visible in jar DS-partial-bean-impl.
> >
> > A possible solution for this can be:
> > BeanMangerProvider#getBeanManager(): extend decision on lookup strategy
> > like
> >     private static boolean useDelegateLookup()
> >     {
> >         return CoreBaseConfig.BeanManagerIntegration.DELEGATE_LOOKUP
> >                 && System.getProperty("jboss.server.name") == null;
> >     }
> >
> > Then all tests in partial-bean-impl -P wildfly-build-managed run
> > successfully!
> >
> > Another issue that could be resolved this way: TransactionStrategy lookup
> > in data-impl:
> > Instead of @Priority workaround
> >   - activate ContainerMangedTxStrategy in beans.xml
> >   - and change Injection of TransactionStrategy in
> TransactionalQueryRunner
> > like:
> >     protected Object executeTransactional(final QueryBuilder builder,
> final
> > CdiQueryInvocationContext context)
> >     {
> >         TransactionStrategy strategy =
> > BeanProvider.getContextualReference(TransactionStrategy.class);
> >
> > will also work fine!
> >
> > Just to show the massive impact of the identified (supposed?) bug in
> > Wildfly subdeployment class visibility.
> >
> > First step: your feedback on the proposed (temporary?) fix on
> > abovementioned change in BeanManagerLookup
> > :-/
> >
>

Re: DS-2.0.0 - Wildfly - BeanMangerDelegate - subdeployment reverse bean visibilty issue

Posted by Thomas Andraschko <an...@gmail.com>.
Can we just set this property based on the profiles for our tests?
This is probably also required for payara users, we have to add it to the
docs then of course.

Am So., 10. März 2024 um 14:49 Uhr schrieb Thomas Frühbeck <
t.fruehbeck@gmail.com>:

> We have already discussed the problem of interceptorLookup for PartialBean
> on Wildfly.
> IMHO due to subdeployment CL-visibilty issues (not flat!) the interceptors
> in jar A are not visible in jar DS-partial-bean-impl.
>
> A possible solution for this can be:
> BeanMangerProvider#getBeanManager(): extend decision on lookup strategy
> like
>     private static boolean useDelegateLookup()
>     {
>         return CoreBaseConfig.BeanManagerIntegration.DELEGATE_LOOKUP
>                 && System.getProperty("jboss.server.name") == null;
>     }
>
> Then all tests in partial-bean-impl -P wildfly-build-managed run
> successfully!
>
> Another issue that could be resolved this way: TransactionStrategy lookup
> in data-impl:
> Instead of @Priority workaround
>   - activate ContainerMangedTxStrategy in beans.xml
>   - and change Injection of TransactionStrategy in TransactionalQueryRunner
> like:
>     protected Object executeTransactional(final QueryBuilder builder, final
> CdiQueryInvocationContext context)
>     {
>         TransactionStrategy strategy =
> BeanProvider.getContextualReference(TransactionStrategy.class);
>
> will also work fine!
>
> Just to show the massive impact of the identified (supposed?) bug in
> Wildfly subdeployment class visibility.
>
> First step: your feedback on the proposed (temporary?) fix on
> abovementioned change in BeanManagerLookup
> :-/
>