-
Notifications
You must be signed in to change notification settings - Fork 307
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
Bug Report: Implementing JAX-RS resources using Generated Interfaces #5553
Comments
This works on Wildfly/JBoss |
Hi @mhlulani, Kindly refer to - #3944 (comment) / #3944 (comment). These already address your issue. But you can raise an Enhancement Request describing your concern. |
I see, this is such a shame https://jakarta.ee/specifications/restful-ws/3.0/jakarta-restful-ws-spec-3.0.html#annotationinheritance My whole project was based on this solution |
Hi, The specification mention that annotations should only be on methods of the inherited interface, not the interface itself. (first sentence of the link to the spec you made)
In your example, you have a @path on the interface class definition itself which triggers Jersey, the JAX-RS implementation to indicate the interface isn't a valid JAX-RS resource (as according to the spec). But besides the Stacktrace, the endpoint should be usable although it is not as defined by the specification. Best Regards |
@hlulani-eoh, as @rdebusscher stated, the behaviour that you have reported is not an issue of Payara Server, since We'll proceed to close this issue since there's nothing to fix at the moment. |
@fturizo Thank you, |
Description
I'm using a maven-plugin (options) to generate only interfaces (along with models) and in turn implement those interfaces when creating a new JAX-RS resource. The generated code is a separate Maven project (JAR) which is simply referenced as a dependency in my microservice project.
This works on Wildfly but on Payara (MicroProfile) it identifies on the endpoints/resources correctly,
but fails when you try accessing the resource, it tries to instantiate the interface as apposed to the actual implementation
As a team of developers and other non-developers, this helps bind our services to a specific contract which is defined by the open-api spec (yaml).
Expected Outcome
The concrete implementation should be instantiated because we cannot instantiate an Abstract class or Interface
Current Outcome
When accessing any of these resources with implement an interface we get the following error:
Steps to reproduce
You can create a new project using https://start.microprofile.io using the following configurations:
@ApplicationPath should not need any modification but MUST be present
I'm using a generated interface but even just creating one within the same project has the same result:
Implement the interface in a concrete class (JAX-RS resource)
Build Service
Run Service
Sending requests:
curl "http://localhost:8080/v2/foo"
Environment
The text was updated successfully, but these errors were encountered: