-
Notifications
You must be signed in to change notification settings - Fork 121
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
FactoryFinder does not respect the SystemProperty of factoryId #1259
Comments
I don't see where it's defined that the system property must be used first. The property is checked, but it's the last option not the first. |
I do not say that is must be first step to Instanciate the SystemPropertys Class. IF SystemPropertys is set. |
I have never felt it had been meant to be a System property. I understand it to be a name of a @stbischof Can you please describe a use-case of yours that would require the service name to be renamed via the System property? Have you got multiple Client implementations on the classpath? |
One of the cases is like that, what i found on GitHub. But. I see that the spec there is... Not very descriptive. The usecase is to set an own ClientBuilder class. That you can modify the default. Also if there are several impls on classpath like in an OSGi Setup you need an Option to select the one you like to have. |
It does look for the property in the rest/jaxrs-api/src/main/java/jakarta/ws/rs/client/FactoryFinder.java Lines 125 to 161 in 895716b
In other words, it does work, but not as you're expecting. I'm not an OSGi expert by any means, but it seems like you'd need to have your service "higher" on the class path or remove the other implementation. |
If the SystemProperty "jakarta.ws.rs.client.ClientBuilder" is set, the FactoryFinder must respect this value when searching for e.g. ClientBuilder using ServiceLoader. If set, all ClientBuilder without matching classname must be ignored.
Spec:
Code:
rest/jaxrs-api/src/main/java/jakarta/ws/rs/client/FactoryFinder.java
Line 179 in 895716b
Issue:
The method
FactoryFinder.findFirstService
gets thefactoryId
but doer not use it.Test:
I can to a PR
The text was updated successfully, but these errors were encountered: