Questions tagged [application.properties]

application.properties is the configuration file to configure dynamic properties for the application. It holds configuration properties in the form of key-value pair

application.properties is the configuration file to configure dynamic properties for the application. It holds configuration properties in the form of key-value pair

409 questions
0
votes
2 answers

Call Spring Boot Application Property From Other Property Or Java VM Option

I have a property like below in Spring Boot application.properties: spring.datasource.url=jdbc:mysql://localhost:3306/my_db?serverTimezone=UTC&connectTimeout=10000&socketTimeout=30000 In here, I want to give…
Sha
  • 921
  • 17
  • 46
0
votes
2 answers

"java.lang.IllegalStateException: Cannot load driver class" in Spring Boot application

I am using to configure spring boot with an external YAML configuration and CMD. -> application.yml file spring: profiles: integration-test datasource: driverClassName: ${SPRING_DATASOURCE_DRIVER_CLASS_NAME} url:…
Monoem Youneb
  • 95
  • 1
  • 12
0
votes
0 answers

how to set application.properties runtime through API?

I want to update the application.properties when i login the application. public class DemoApplication { @Value("${spring.application.webServer}") private String webServer; public static void main(String[] args) { …
user3510365
0
votes
2 answers

Spring Boot - Unable to connect Azure MySQL database

I am new in connecting azure MySQL database from Spring boot application. Below is the snippet mentioned in application.properties spring.datasource.url=jdbc:mysql://XXXX.mysql.database.azure.com:3306/MyDbName spring.datasource.username=…
Rakesh L
  • 1,136
  • 4
  • 18
  • 44
0
votes
0 answers

How to access value defined application.properties file outside of class in Spring Boot

I want to put a value from my application.properties in my @RequestMapping path outside my class. I know that inside a class you can do something like this: @Value("${property.value}") private String propertyValue; I need something like this, but…
The Dude
  • 1,088
  • 7
  • 16
  • 30
0
votes
1 answer

Split doesn't work with AbstractEnvironment.getProperty

I have following property in my application.properties file. test.product.release.version=2003.1 test.product.release.year=#{'${test.product.release.version}'.split('[.]')[0] When I use the property test.product.release.year in my spring controller…
user11858468
0
votes
0 answers

Different properties for different modules in Multi Module Spring Boot project

I have a multi module Spring Boot Application with following folder…
Mohammed Atif
  • 4,383
  • 7
  • 28
  • 57
0
votes
1 answer

SpringBoot application with multiple application.properties running under Tomcat

I need two application.properties in my Spring Boot App. I know that using the annotation @PropertySource I can specify more than 1 property files. I tried to use:…
0
votes
0 answers

Why filter doesn't work inside filesMatching statement?

I have a Spring Boot project. My application.properties has a line: myproject.version=@version@ My build I have a spring boot project. I need to set project version in application.properties from gradle. I have tried to use filtering in…
Max Valeev
  • 75
  • 5
0
votes
1 answer

spring.jackson.date-format property does not work properly for the date serialization with @Temporal annotation

I have the following property in application.properties file: spring.jackson.date-format=yyyy-MMM-dd There is object definition to be serialized: public class InjuryDTO { private Long id; private String kindOfInjury; private String…
Maksim
  • 351
  • 1
  • 2
  • 12
0
votes
1 answer

Losing Spring @Value("${}") when instantiate class

I'm using SpringBoot 2.1.3 (Embedded Tomcat) + Thymeleaf 3.0 + Java 8. I have a simple class like this: @Data public class Machine { private Integer price; @Value("${settings.default}") private String settings; } And a simple…
CoderJammer
  • 599
  • 3
  • 8
  • 27
0
votes
1 answer

Spring Boot passing value / using method inside the application.properties

For example: I have a class called Path.java In Path.java, I have getter method "getPort()" that returns int 8080 In application.properties, I want to use server.port = "getPort()" How? I want to externalize the datasource. I already have a…
Cho
  • 11
  • 5
0
votes
1 answer

Spring boot server fails to start embedded tomcat server

The embedded tomcat server fails to start when running my spring boot application. I have just added the required dependencies in pom.xml and have created a simple java POJO class. The application properties have been set with required jdbc…
svijay.aug12
  • 531
  • 3
  • 13
  • 32
0
votes
2 answers

How to edit application.properties during runtime (for next time use)

I want to be able to check if a script exists in a Redis cluster. If it doesn't, I will need to load a new script from my resources folder and save the corresponding SHA value of that new script. I would like to save that SHA value for next time the…
dk40149
  • 99
  • 1
  • 10
0
votes
2 answers

many of the same propertis get like list of Instances

How to prepare properties in application.properties so in javas side, get like List server.ip=192.168.0.0 server.login=login1 server.password=password1 server.ip=192.168.0.1 server.login=login2 server.password=password2 originally properties were…
Waldemar
  • 55
  • 6