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
Build failure due to NullPointerException
, related to @Parameter(ref = ...)
processing
#26848
Comments
NullPointerException
, related to @Parameter
processingNullPointerException
, related to @Parameter(ref = ...)
processing
Have not been able to reproduce with the sample project, but unfortunately quite easy to get it to resurface accidentally on the bigger project, when replacing in-line |
Yay! Was able to make reproduction work: for some reason specific RESTeasy implementation is needed. Now sample project triggers the failure I see locally on the bigger project. |
Ok, so firstly, we definitely need a null check and give a better message. That is code in MicroProfile, so not something we can fix and release, it needs to go through the process. I'll start that. The issue here is that we do not know where to assume the parameter is. There is no
OR
Hope this helps. Thanks for the bug, I'll see if we can build a check into SmallRye OpenAPI to provide a better error message. I'll probably move this issue to SmallRye if you are OK with the above. |
@phillip-kruger I am not saying that the second annotation shouldn't be needed (if it could be avoided, nice, but I can see why this may not be practical). My only real concern is just the unhelpful exception failure; as long as that is avoided and user can be given something indicating the problem that's perfectly fine. So this is caused by my missing one And yes, moving the issue wherever it should be is fine. I encountered it via Quarkus so I filed it here but if and when it belongs to SmallRye (OpenApi handling) definitely transfer/recreate it there. Thank you for a very quick follow-up! |
Yes agree we should do better with the error message. We should be able to do this in SmallRye so I'll move this there. Closing here. Thanks again :) |
Oh. One minor other thing: I think But I can check the situation again once the underlying root cause is resolved. Thank you once again! |
I do not follow ? |
Definition that was referenced (
and reference to it looks like:
so it seems to me that information is at least theoretically available. I hope this helps -- the sample repo has the pertinent example. |
Describe the bug
When trying to build project with
./mvn clean verify
(etc), with certain endpoint definitions I get following stack trace (first part, full is longer):Issue seems to be triggered with endpoint definition like so:
wherein parameter in question uses a (valid) reference but does not have matching
@QueryParam
(or similar).In my particular case annotations are defined in an
interface
, implemented by actual sub-class, if that matters. Parameter definition reference is defined in "application" class which is found.It also looks like failure only occurs when
quarkus-resteasy-reactive
is used as the dependency (earlier had trouble to reproduce with "classic").Expected behavior
Build should either work or indicate the underlying problem (inability to figure out type of parameter for OpenAPI?); but would not fail with NPE.
Actual behavior
Build fails as a side effect of an internal
NullPointerException
being thrown.See the stack trace in the description.
I will also try to isolate the failure case in a smaller project, if possible. The full project won't be possible to include due to its size (although theoretically maybe I could create a branch as this is for an OSS project, not closed).
How to Reproduce?
Here's a project for reproduction
https://github.com/tatu-at-datastax/quarkus-demo
where simple
./mvnw clean verify
should show failure.Output of
uname -a
orver
Darwin Kernel Version 20.6.0
Output of
java -version
openjdk version "17.0.2" 2022-01-18
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.10.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: