Skip to content
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

NoClassDefFound when generating classes from openapi specs #22548

Closed
oscarfh opened this issue Dec 29, 2021 · 2 comments
Closed

NoClassDefFound when generating classes from openapi specs #22548

oscarfh opened this issue Dec 29, 2021 · 2 comments
Labels

Comments

@oscarfh
Copy link
Contributor

oscarfh commented Dec 29, 2021

Describe the bug

I think this is somehow related to these issues, even though not exactly the same thing.
#2809
#16613

I tried to create a reproducer, but I did not manage to reproduce it in a smaller project.

Context:
I have a project that generates classes from an openapi specification into build/generated-resources/.... When the application starts, I can see al the generated resources in the list of banned elements.
When I call an endpoint which references such dependency, I get a NoClassDefFoundError because my resource is banned.

In my reproducer, I can see the resources being banned at the start of the application, but when the endpoint is called, the list of banned resources is empty.

Building the jar the running java -jar quarkus-run.jar runs perfectly.

Expected behavior

Generated resources should be "resolvable"

Actual behavior

NoClassDefFoundError is thrown when referencing generated resources

How to Reproduce?

I am trying to generate a reproducer.

Output of uname -a or ver

Linux 5.11.0-41-generic #45~20.04.1-Ubuntu

Output of java -version

openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.4.2-final

Build tool (ie. output of mvnw --version or gradlew --version)

gradle

Additional information

No response

Edit1: It seems that I am getting this exception from the "Quarkus Base Runtime ClassLoader", while, from my understanding, this class should be retrieved from the "Quarkus Runtime ClassLoader".

@oscarfh oscarfh added the kind/bug Something isn't working label Dec 29, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 29, 2021

@oscarfh
Copy link
Contributor Author

oscarfh commented Dec 30, 2021

Feel free to close. This was due to an split package issue.
I was able to fix the issue by excluding some transitive dependencies, but I did not solve my problem. I asked for support here, in case someone is interested (because it is for sure not a problem in Quarkus): https://stackoverflow.com/questions/70526299/noclassdeffounderror-on-quarkus-zig-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants