Describe the bug
in the quarkus-rest-client if you forget to include the @RestClient you get a very misleading error message. A partial example stack trace is below.
Expected behavior
A better error message and/or stack trace indicating the problem. Or a compile time error indicating the missing value.
Actual behavior
this is the stack you get back (partial)
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.pophealth.client.HealthDataService and qualifiers [@Default]
- java member: org.pophealth.googleFit.FitServlet#healthDataService
- declared on CLASS bean [types=[javax.servlet.ServletConfig, java.io.Serializable, javax.servlet.GenericServlet, com.google.api.client.extensions.servlet.auth.oauth2.AbstractAuthorizationCodeServlet, javax.servlet.Servlet, java.lang.Object, org.pophealth.googleFit.FitServlet, javax.servlet.http.HttpServlet], qualifiers=[@Default, @Any], target=org.pophealth.googleFit.FitServlet]
at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:487)
at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:362)
at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:226)
... 14 more
Now assume you know what you're doing (you're a clever guy, who needs a guide?) and create another rest client but forget to include @RestClient in the injected service bean. Or just remove it from the injection in step 1.
mvn clean compile quarkus:dev
Get exception
Configuration
N/A - follow the rest-client guide for required properties there.
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
Output of uname -a or ver:
Darwin Josephs-MBP.homenet.telecomitalia.it 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Output of java -version:
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
GraalVM version (if different from Java):
Quarkus version or git rev:
1.6.0.Final
Build tool (ie. output of mvnw --version or gradlew --version):
Additional context
Part of my stack is because i'm injecting the bean in a servlet but it would be similar elsewhere.
Not a huge issue but the rest-client could be a common getting started flow and the stack that is produced is tough to identify the missing annotation.
Describe the bug in the
quarkus-rest-client
if you forget to include the@RestClient
you get a very misleading error message. A partial example stack trace is below.Expected behavior A better error message and/or stack trace indicating the problem. Or a compile time error indicating the missing value.
Actual behavior this is the stack you get back (partial)
To Reproduce Steps to reproduce the behavior:
@RestClient
in the injected service bean. Or just remove it from the injection in step 1.mvn clean compile quarkus:dev
Configuration N/A - follow the rest-client guide for required properties there.
Screenshots (If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
Output of
uname -a
orver
:Darwin Josephs-MBP.homenet.telecomitalia.it 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Output of
java -version
:GraalVM version (if different from Java):
Quarkus version or git rev:
1.6.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
):Additional context Part of my stack is because i'm injecting the bean in a servlet but it would be similar elsewhere.
Not a huge issue but the rest-client could be a common getting started flow and the stack that is produced is tough to identify the missing annotation.
https://github.com/quarkusio/quarkus/issues/10898
$upstream:10898$