property-placeholder

How to reload a properties file in Apache Camel 2.12?

青春壹個敷衍的年華 提交于 2019-12-25 06:58:15
问题 I want to do two things: Load a properties into a bean and update the bean when properties is updated. I use JBoss Fuse 6.1 where to install my application bundle and have a properties file on the server where I need to read some configuration. The properties have the follow line: mediaTypeList=JSON,DOCX,TXT And I have a Java Bean that is a mirror of the file property: public class MediatType { private List<String> mediaTypeList; // GETTERs and SETTERs } The property mediaTypeList indicate

LocalDate with Property place holder Spring

ぐ巨炮叔叔 提交于 2019-12-24 10:36:47
问题 I am working with Spring Boot and property placeholders. I have a property file with the value : date.A=24/07/17 . I have a class and I am using the @Value annotation: @Value("${date.A}") private LocalDate dateA; But I am getting the runtime error when running gradle build integrationTest : Caused by: java.time.format.DateTimeParseException: Text '24/07/17' could not be parsed: Invalid value for MonthOfYear (valid values 1 - 12): 24 at java.time.format.DateTimeFormatter.createError

Spring boot integration test with SpringApplicationConfiguration doesn't seem to resolve @Value annotation

点点圈 提交于 2019-12-24 01:37:14
问题 I have an integration test set up like: @RunWith(SpringJUnit4ClassRunner.class) @SpringApplicationConfiguration(classes = {XmlFileSplitter.class, ...}) public class XmlFileSplitterTests { .. In the XmlFileSplitter I have a property that is annotated with @Value("${default.output.file}") and its value is retrieved from the application.properties . This works fine when running the app normally. However when running the integration test, the value is not resolved (it is " ${default.output.file}

SpringBoot don't replacen System variable {user.home} in Spring Tool Suite Version: 3.8.4.RELEASE

ⅰ亾dé卋堺 提交于 2019-12-23 02:58:12
问题 I've generated a Spring Boot web application using Spring Initializr, using embedded Tomcat + Thymeleaf template engine in a macOS Sierra. I want to use the System variable User Home Folder Name in Mac OS I have this Spring class configuration in my Spring Boot application @Configuration @Profile("dev") @PropertySource("file:///{user.home}/.devopsbuddy/application-dev.properties") public class DevelopmentConfig { @Bean public EmailService emailService() { return new MockEmailService(); } }

Spring @Value TypeMismatchException:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Double'

ぐ巨炮叔叔 提交于 2019-12-03 08:17:30
问题 I want to use the @Value annotation to inject a Double property such as: @Service public class MyService { @Value("${item.priceFactor}") private Double priceFactor = 0.1; // ... and using Spring property placeholder (Properties files): item.priceFactor=0.1 I get Exception: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Double'; nested exception is java.lang.NumberFormatException: For input string: "${item

Spring @Value TypeMismatchException:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Double'

时光总嘲笑我的痴心妄想 提交于 2019-12-02 23:36:42
I want to use the @Value annotation to inject a Double property such as: @Service public class MyService { @Value("${item.priceFactor}") private Double priceFactor = 0.1; // ... and using Spring property placeholder (Properties files): item.priceFactor=0.1 I get Exception: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Double'; nested exception is java.lang.NumberFormatException: For input string: "${item.priceFactor}" Is there a way to use a Double value coming from a properties file? Try changing the following

How to resolve placeholder in properties file with values from another properties file in spring boot application

浪子不回头ぞ 提交于 2019-12-02 08:33:47
问题 My spring boot application has below properties files. src/main/resources/config/DEV/env.properties mail.server=dev.mail.domain src/main/resources/config/QA/env.properties mail.server=qa.mail.domain src/main/resources/config/common/env.properties mail.url=${mail.server}/endpoint Is it possible to load "common/env.properties" so that it's placeholders will be resolved using the given environment specific properties file. For DEV environment, we want the placeholders in "common/env.properties"

How to resolve placeholder in properties file with values from another properties file in spring boot application

拟墨画扇 提交于 2019-12-02 08:06:15
My spring boot application has below properties files. src/main/resources/config/DEV/env.properties mail.server=dev.mail.domain src/main/resources/config/QA/env.properties mail.server=qa.mail.domain src/main/resources/config/common/env.properties mail.url=${mail.server}/endpoint Is it possible to load "common/env.properties" so that it's placeholders will be resolved using the given environment specific properties file. For DEV environment, we want the placeholders in "common/env.properties" to be resolved using values from "DEV/env.properties". There are answers about how to load multiple