[英]SpringBoot 2 migration ConfigurationProperties Failed to bind property to String[]
I just migrate from Spring boot 1.5.8 to 2.0.0 我只是从Spring Boot 1.5.8迁移到2.0.0
I solved most of migration errors, but I have no idea for this: 我解决了大多数迁移错误,但是对此我一无所知:
@Configuration
public class LdapConfiguration {
@Bean
@ConfigurationProperties(prefix = "ldap")
public LdapContextSource contextSource() {
return new LdapContextSource();
}
@Bean(name = "ldapTemplate")
public LdapTemplate ldapTemplate(ContextSource contextSource) {
return new LdapTemplate(contextSource);
}
}
My custom values (all variables are var env property, this is why the separator is "_"): 我的自定义值(所有变量均为var env属性,这就是分隔符为“ _”的原因):
LDAP_URLS=ldaps://ldap-url.com:636/
Error : 错误:
Description:
Failed to bind properties under 'ldap.urls' to java.lang.String[]:
Reason: Unable to get value for property urls
Action:
Update your application's configuration
looks like it can't bind my string value ldap.urls to String[], I tried with 2 values in my property separated by coma. 似乎无法将我的字符串值ldap.urls绑定到String [],我尝试用逗号分隔属性中的2个值。
Any idea ? 任何想法 ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.