Affects: 6.0.11
As the title says, I want to set the URL from the property similar to the following.
@HttpExchange("${platform.token-url}")
I hoped it to work because the same thing works in @RequestMapping
, but get the following error.
java.lang.IllegalArgumentException: Map has no value for 'platform.token-url'
at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
at org.springframework.web.util.HierarchicalUriComponents$FullPathComponent.expand(HierarchicalUriComponents.java:921)
at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:439)
at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:52)
at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
at org.springframework.web.util.DefaultUriBuilderFactory$DefaultUriBuilder.build(DefaultUriBuilderFactory.java:391)
at org.springframework.web.util.DefaultUriBuilderFactory.expand(DefaultUriBuilderFactory.java:149)
at org.springframework.web.reactive.function.client.DefaultWebClient$DefaultRequestBodyUriSpec.uri(DefaultWebClient.java:233)
at org.springframework.web.reactive.function.client.DefaultWebClient$DefaultRequestBodyUriSpec.uri(DefaultWebClient.java:194)
at org.springframework.web.reactive.function.client.support.WebClientAdapter.newRequest(WebClientAdapter.java:103)
at org.springframework.web.reactive.function.client.support.WebClientAdapter.requestToBody(WebClientAdapter.java:67)
at org.springframework.web.service.invoker.HttpServiceMethod$ResponseFunction.lambda$initBodyFunction$5(HttpServiceMethod.java:391)
at org.springframework.web.service.invoker.HttpServiceMethod$ResponseFunction.execute(HttpServiceMethod.java:294)
at org.springframework.web.service.invoker.HttpServiceMethod.invoke(HttpServiceMethod.java:111)
at org.springframework.web.service.invoker.HttpServiceProxyFactory$HttpServiceMethodInterceptor.invoke(HttpServiceProxyFactory.java:278)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:244)
at jdk.proxy4/jdk.proxy4.$Proxy167.authorizeTrustedClient(Unknown Source)
Opening an issue since I couldn’t find any for it.
Comment From: sbrannen
As stated in https://github.com/spring-projects/spring-framework/issues/30125#issuecomment-1485343138, you need to "make sure that you are setting embeddedValueResolver
on the HttpServiceProxyFactory
builder."
In light of that, I am closing this issue.
If the above solution does not work for you, please post back here.