-
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
java.lang.NullPointerException: Cannot invoke "org.jboss.jandex.ClassInfo.classAnnotations()" because "classInfo" is null #30254
Comments
Thanks for reporting. Any chance you can attach a sample application we can use to check? |
This is using classic RESTEasy. Looking at In any case, to help debugging this, it would be helpful to put a breakpoint at line 64 of |
still getting the issue with latest version:
|
Not without a sample project we can run locally without any jumping through hoops. |
Please see #30254 (comment), that's the best I can do with the information provided in this issue. |
@geoand could you guys please provide a little starter project with an in memory h2 db and the default quarkus application. |
I would start with a project generated from https://code.quarkus.io/?e=jdbc-h2&e=resteasy&e=smallrye-openapi&e=hibernate-orm-panache&e=hibernate-orm-rest-data-panache&extension-search=origin:platform%20rest |
thanks a lot for your suggestion. could you please extend the demo its not working quite well. the maven verion did out of the box worked fine but we have a kotlin stack. https://github.com/punkratz312/quarkus-panach-debug-starter is there a problem with the dependencies ? |
You are mixing both Hibernate ORM and Hibernate Reactive, hence the error |
whats the issue now, please? feel free to update the startet by yourself and integrate the failing panach entity resource. https://github.com/punkratz312/quarkus-panach-debug-starter |
With the amount of work that I need to do for Quarkus 3, I cannot spend time on fixing the reproducer. The only way I can look at this is if the sample you added actually faithfully reproduces the problem described in the original report. |
do you have someone to help please ? its just the absolute minimum of the quarkus panache stack required to injtect the bug. its really sad to see that you dont have this everyday usefull kind of starter project allready going. so every bug reporter has to create a new project to start and help you with fixing you stuff. instead spend a little effort on a OUT OF THE BOX working starter demo project that everyone can use and checkout. integrate this in the template markdown as you have a pretti sufuscicated on already with all kinds of extra steps here and there. why not deliverying the solution to the customers that will bring you valuable but report information as quarkus is full of them, as i spend here so much time i feel like to need to get an extra paycheck from redhead, even tho its open source... |
If you are a Red Hat customer, please open a support request on the Red Hat customer portal. If not, please stop posting random screenshots -- they are not helpful at all. If you want to help fix the bug and cannot get a reproducer working, I suggest you follow the instructions I mentioned in 2nd paragraph of this comment, more than a month ago. None of your screenshots seem to show that, even if that would actually be very useful. Thanks. |
Also take a look at https://github.com/quarkusio/quarkus-quickstarts/tree/main/hibernate-orm-panache-kotlin-quickstart if you're looking for an example of using Panache with Kotlin |
@punkratz312 I'm closing this issue given your attitude. We have been plenty helpful, we asked for a simple reproducer since the beginning of the issue. If you don't want to provide one, we cannot help as your issue is not obvious. When you have a proper reproducer, feel free to open a new issue with it attached. And in the future, please have a more constructive attitude. |
@gsmet @maxandersen im expecting the issue to be quarkus internal only this approach is pretty simple and it causes the same NPE: |
@punkratz312 typing of screenshots is quite tedious and error prone. If you are able to recreate the issue that easily could you upload a reproducer using code.quarkus.io or a quickstart as a starting point? I've added code to quarkus main to report more precisely which annotated class is causing issues but still not been able to reproduce it. I'm assuming there is something in your dependencies and setup I'm missing. Thus a simple reproducer (not just screenshots) would be immensely useful. Thanks. |
@punkratz312 if the approach to reproducing the issue is simple, then it should not be difficult to provide us with a sample application that reliably reproduces the issue. As had been said multiple times already, screenshots do not help us at all |
@geoand i did not found an out of the box running quarkus panache application. the problem for is the db setup. it requires and in memory h2 setup and connection this part i cant deliver so no db means no panache means no reproducer im sorry. |
Quarkus can start H2 for you, see this You can also populate the database with data as mentioned here. I'll say this one last time: In this case, no reproducer means we won't spend any more time on this. If you can provide us one, we'll be able to address the issue (which I am guessing is some extreme corner case that can be easily fixed). |
I think you're pretty close, you just need to be able to look back up one stackframe. Note that the |
You can use the same |
Screen.Recording.2023-02-27.at.11.04.23.mov |
its some class loading issue like @Ladicek mentioned before. i understand its pocking in the fogginess without a reproducer. |
Are you mixing quarkus-resteasy and quarkus-resteasy-reactive dependencies? |
@geoand might be but i think we did not changed alot in these spheres: |
excluding quarkus-rest-client-reactive-jackson did not changed the npe, i´ve already tested this multiple times: @geoand which dependency should i exclude next? the other once then make whole panache disappear 🫠 🫥 . that felt quite wrong. |
@punkratz312 github has this nice feature of code formatting using code blocks. Could you please use that rather than screenshots of texts? Much appreciated! Also ChatGPT's answers are in some places wrong but overall in this case they are saying exactly the same as we say - that there is a class in your environment that is causing an issue in resteasy. Thus without reproducer or some hint on what class that is causing issues (you should be able to find it with a debugger) then we are without much pointers on where to look. |
Yes. That's what we see too. That it works in default setup thus there is some class in your setup that triggers the issue. If you put a null pointer exception breakpoint you should be able to go up the stack frames and see which class/type is causing the problem. |
@maxandersen thanks for the hint. how can i find the root cause? the stack trace it always the same: conslusion: the panache generated resources gets sustainable compromised in our application. |
the npe would be fixed if the hasSecurityAnnotation line would check, or assert, for null as this is possible. but then the resource neither would be process correctly i think. so this might not be the final solution, but at least more robust in some ways. |
If we have a sample application, we can get to the bottom of the problem and make things more robust for everyone. Simply guarding against the NPE won't really help unless we understand why null is being used |
I think I know what's wrong here. This screenshot https://user-images.githubusercontent.com/8830888/222369120-9f5586b6-9479-4f86-bd8e-d34677703d8d.png shows a situation where On the other hand, this screenshot https://user-images.githubusercontent.com/8830888/222369042-e4048bc9-2f8e-48ac-9436-7d11fdd40fc8.png shows a situation where I don't know exactly how I would approach fixing this, but as a workaround, I'd suggest just getting rid of REST Data with Panache and implementing the necessary JAX-RS resources manually. |
java.lang.ClassNotFoundException: boolean
|
next issue StackOverflowError when path collision with other resources: works: collision:
|
always the edge cases im sorry |
Now would be a good time to try again and create a sample project to share with us |
Did you see #30254 (comment) ? Try look at those entities mentioned and replicate them in your reproducer ? |
Describe the bug
Enabling
quarkus.security.jaxrs.default-roles-allowed=admin
orquarkus.security.jaxrs.deny-unannotated-endpoints=true
causes:Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: