У меня есть класс конфигурации, который загружает свойства как
WebConfig.java
Код: Выделить всё
@Configuration
@PropertySource(value={"classpath:application.properties"})
class WebConfig extends WebMvcConfigurerAdapter{
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
return new PropertySourcesPlaceholderConfigurer();
}
}
MyServerConfig.java
Код: Выделить всё
@Configuration
class MyServerConfig {
@Value("${server.url}")
private String url;
...
}
Код: Выделить всё
server.url=http://localhost:8080/test/abc
java.lang.IllegalArgumentException: не удалось разрешить заполнитель 'server.url'.
Не знаете, чего здесь не хватает? Есть мысли?
Подробнее здесь: https://stackoverflow.com/questions/465 ... figuration
Мобильная версия