-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom cdi context not applied for certain bean types #33417
Comments
For tracking purposes, this originated from SO question - https://stackoverflow.com/questions/76261145/my-custom-cdi-context-is-not-getting-applied-called/ Will take a look at your code tomorrow. |
Thank you :) I was looking at those already too. But they do not target any bean types as |
@HerrDerb It's quite a gem you encountered here - the cause of this issue isn't custom context at all; your definition of context should be good. However, your context is a normal scope requiring a client proxy and the bean you are trying to produce is
Normally, Quarkus will try to bypass this limitation and transform methods (removing TL&DR is that this is reproducible with any normal scope and not being able to have a normal scoped bean on top of |
I've only checked if the class is final and skipped the methods... 🧐 |
@HerrDerb the PR is #33440 and shows the WARN you'll be seeing
Yes, Arc is very lenient in that it doesn't blow up on finding such method but instead tries to skip it allowing users to have proxies even on top of classes that have some method As a final note - if you want to have an |
@manovotn Cool, thank you🙂 |
Describe the bug
When using a custom
InjectableContext
the context implementation is not beeing used for all bean types.Expected behavior
Either all beans that are annotated with my scope annotation should be handled over my context implementation or if not a clear feedback (visible log or exception) should be given from Quarkus.
Actual behavior
When having certain beantype e.g.
AtomicBoolean
, the context implementation is ignoredIt is still scoped as
@MyCustomScoped
when checking withArc.container().instance(AtomicBoolean.class).getBean().getScope();
but the bean is not beeing handled over my context implementation.How to Reproduce?
https://github.com/HerrDerb/extension-issues/tree/custom-context-issue
Quarkus version or git rev
3.0.3Final
The text was updated successfully, but these errors were encountered: