-
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
Compilation error on using Generics for Rest Client: java.lang.RuntimeException: Invalid type for descriptor T #43011
Comments
/cc @cescoffier (rest-client), @geoand (rest-client) |
This is kind of a weird case to be honest... I absolutely understand what you are trying to do, but currently there is no way to tell Quarkus to not make Perhaps we could introduce something like |
Let me understand. Quarkus try to create the Rest Client proxy from the child interface which is annotated and from the father interface, which is not annotated? |
It tries to create them for all the interfaces in your case |
The |
Unfortunately that would not work because it's perfectly valid to have non annotated interfaces for the rest client |
Is it mandated? Because I can see how it could be impractical in the end. Being explicit about when you want a client doesn’t seem too far fetched? Also in this very case, maybe we should just skip it? It’s not annotated and it’s invalid, looks like something we could skip? |
Yes, otherwise the programmatic usage won't work
Invalid how? You mean because of the generics? |
Yeah, I mean if we know we cannot instantiate it, we might as well skip it. |
Potentially, but there could be corner cases |
We also just stumbled upon this issue. This was working before we updated our dependencies from |
Describe the bug
When creating clients for Rest Service, I was trying to create a generic interface to map the methods from
PanacheEntityResource
class that's used to create services for entities:I have created a simple project ( code-with-quarkus.zip ) to show the problem. The regular Java compilation (without tests) runs fine, but when the client is used, the problem appears:
If I implement without the interface, it works fine.
Expected behavior
Use a generic super interface to map common methods.
Actual behavior
See the above stack trace.
How to Reproduce?
See the attached sample project.
Output of
uname -a
orver
Output of
java -version
Quarkus version or git rev
3.14.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
No response
The text was updated successfully, but these errors were encountered: