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
JSON-B type adapter can't inject CDI beans #11340
Comments
I think it would work if you added a scope annotation to your adapter. It's indeed the same issue as the one you reported with HV. I'm not sure it's a good idea to add scope annotations automatically everywhere via annotation transformers. @mkouba WDYT? |
I'm not sure either. I think that for JAX-RS providers we only add |
Yes, that's probably what we would do here too (I think I would also consider the lifecycle annotations). My question was more: do we want to install this type of mechanism for each potentially injected resources? I don't think we can generalize as the default scope might be different. In other words: is making what looks like CDI beans CDI beans automatically for all the types that could potentially be CDI beans a good thing or not? |
I think that could we generalize the tools, i.e. there could be a higher-level API instead of annotation transformer. But even then an extension would have to produce some kind of build item anyway. I don't think that we should do this for all classes automatically. |
Yeah a build item taking a list of classes and a default scope would be nice. |
...annotation transformers are used to add a scope annotation to a class - also fixes quarkusio#11340
...annotation transformers are used to add a scope annotation to a class - also fixes quarkusio#11340
...annotation transformers are used to add a scope annotation to a class - also fixes quarkusio#11340
When I inject a CDI bean in a
JsonbAdapter
, the instance isnull
and will fail with an NPE without further notice. As specified in the JSON-B spec (JSR 367)4.7.1
, this injection should work.See the following reproducer:
Tested with Quarkus version
1.7.0.Final
. It seems to be a similar issue like in #6094.The text was updated successfully, but these errors were encountered: