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
NPE when using SyntheticBeanBuildItem with BeanCreator #27510
Comments
@rdebusscher Your singleton scope is |
Matej is right. We do fail the build if a class bean is annotated with |
@rdebusscher also the With that, I am getting:
|
@mkouba yea, we could at least check if it is a scope annotation or simply check if the return value is |
Thx for the quick replies and the solution. A few related remarks (although not familiar with the entire architecture)
|
I don't think that's a helpful interpretation. It's more direct: the |
I vaguely recall a discussion where @gsmet explained we cannot really get rid of that? Tomorrow, I'll look into making the validation check the annotation so that there is sensible exception in cases such as this one. |
I discussed with @aloubyansky to see if we could mark the bootstrap Maven and Gradle dependencies as provided (and provide them accordingly where needed) to clean up the extension deployment classpath when developing extensions. |
@rdebusscher the PR cleaning up the classpath of the deployment artifacts has been merged: #27562 |
Describe the bug
I'm creating a Quarkus extension and one of the things I need is to use the replacement for AfterBeanDiscovery.addBean().
But I get a NullPointerException when Quarkus tries to instantiate the bean at runtime (in generated code, so no idea what is null)
A simple reproducer of the problem can be found at https://github.com/rdebusscher/quarkus-syntheticbean
Expected behavior
Ability to instantiate an object myself in code and provide it through the 'CDI injection' system of Quarkus. No exceptions.
Actual behavior
When accessing the endpoint where the bean is injected, following NPE is thrown.
How to Reproduce?
See https://github.com/rdebusscher/quarkus-syntheticbean
Output of
uname -a
orver
Darwin 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "11.0.14.1" 2022-02-08 LTS OpenJDK Runtime Environment Zulu11.54+25-CA (build 11.0.14.1+1-LTS) OpenJDK 64-Bit Server VM Zulu11.54+25-CA (build 11.0.14.1+1-LTS, mixed mode)
GraalVM version (if different from Java)
/
Quarkus version or git rev
<quarkus.version>2.11.1.Final</quarkus.version>
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.2
Additional information
No response
The text was updated successfully, but these errors were encountered: