-
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
Microprofile rest client - Can't inject config/beans to clientheaderfactory also in 1.4.2.Final #9301
Comments
I have the exact same issue. I'm trying to add custom headers to a client and I want to get a property inside of a class that implements |
I have found that adding |
FTR: This is still a problem with 1.7.2.Final. My team also ran into this recently. @mkouba & @phillip-kruger WDYT? Is this something that can be fixed? |
Yes, we just need to handle the |
Awesome, thanks @mkouba! |
Describe the bug
In issue #7531 a solution was given for injecting providers in microprofile rest client using the annotations @RegisterProvider or @RegisterClientHeaders. Unfortunately the fix doesn't seem to work for @RegisterClientHeaders and my injected beans are always null.
Expected behavior
A class that implements ClientHeadersFactory and used in @RegisterClientHeaders annotation should have it's injectable beans injected.
Actual behavior
Any field marked with @Inject is always null. @RegisterProvider works as intended.
To Reproduce
Steps to reproduce the behavior:
Configuration
Using properties from repo.
Screenshots
No screenshot, but a part of the log using above reproduction steps;
Environment (please complete the following information):
uname -a
orver
: Linux garkenbout-laptop-quintor 5.0.0-38-generic Arc - implement CDI inheritance rules properly #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linuxjava -version
: openjdk version "11.0.7" 2020-04-14OpenJDK Runtime Environment 18.9 (build 11.0.7+10)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10, mixed mode)
mvnw --version
orgradlew --version
): Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)Maven home: /home/garkenbout/.m2/wrapper/dists/apache-maven-3.6.2-bin/795eh28tki48bv3l67maojf0ra/apache-maven-3.6.2
Java version: 11.0.7, vendor: Oracle Corporation, runtime: /home/garkenbout/.sdkman/candidates/java/11.0.7-open
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.0.0-38-generic", arch: "amd64", family: "unix"
The text was updated successfully, but these errors were encountered: