spring-boot-configuration

404 spring controller error if JSON string contains number greater than 10 digits

送分小仙女□ 提交于 2021-02-11 12:36:44
问题 I'm having a controller which gets json as string in request body as below @PostMapping("/addUser") public ResponseEntity<?> addUser (@RequestBody String userJson,HttpServletRequest request) { log.info("inside add user controller") String responseStatus = serviceInterface.addUser (userJson); return new ResponseEntity (responseStatus); } The request body is { "user": { "username": "testuser", "userId": 12345678901233, "phonenumber": "9876756475", "emailaddress": "test@org.com" } } The problem

Autocompletion in YML files with Spring configuration doesn't work for map field

爱⌒轻易说出口 提交于 2021-01-29 06:45:42
问题 I'm facing some issues with autocompletion feature for yml files containing spring configuration. I found very similar question on stackoverflow but my reputation is too low to write a comment there. The solution doesn't work for me. I enabled annotation processor I'm using the newest Ultimate version of IntelliJ. I added the following dependency to my pom.xml file: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional

springboot external configuration - profile specific configuration

ぃ、小莉子 提交于 2020-06-26 04:08:35
问题 According to the SpringBoot documentation, the order of configuration is as: Profile-specific application properties outside of your packaged jar (application-{profile}.properties and YAML variants) Profile-specific application properties packaged inside your jar (application-{profile}.properties and YAML variants) Application properties outside of your packaged jar (application.properties and YAML variants). Application properties packaged inside your jar (application.properties and YAML

Shared Config(at git) between SPring Boot Services

巧了我就是萌 提交于 2020-03-06 09:03:19
问题 I am developing spring boot services. So lets say I have 3 Services A, B, C with dev and prod profiles each. Now I am keeping the configuration for these services at GIT and using config server to fetch the configuration. So when I run A service in prod mode, the config file A-prod.properties is getting used. Now I want to keep some common configuration which will be used by all 3 Services say common-prod.properties. How should I do that? I have tried this: Config Server : spring: cloud:

How to set spring.main.allow-bean-definition-overriding to true in a Spring boot 2.1.0 starter configuration

旧巷老猫 提交于 2020-01-23 06:22:05
问题 I maintain a spring-boot-starter that customizes the error attributes returned when, for instance, a unknown end point is called. This is done by overriding the org.springframework.boot.web.servlet.error.ErrorAttributes bean. Everything worked fine with 2.0.6, but 2.1.0 disables bean overriding by default, making the starter now fail with the following message. Invalid bean definition with name 'errorAttributes' defined in class path resource [com/mycompany/springboot/starter/config

Spring Cloud Config Server using SSH key for Git and running in Docker

北慕城南 提交于 2019-12-18 02:53:08
问题 I found many questions and tutorials before finally putting this all together. Wanted to document it so somebody else can save many hours of frustration. I am trying to get a private git repository on BitBucket to work with Spring Boot Config Server using deploy keys and have it run in Docker. I am running into many issues. How to actually configure using the application.yml files. I cant seem to figure out where I should put the SSH info. All tutorials seem to be for https. How to provide

Externalising Spring Boot properties when deploying to Docker

五迷三道 提交于 2019-11-28 21:21:34
In my Spring Boot app I want to externalise the properties to run in a Docker container. When first deployed, the properties that are currently in my-server/src/main/resources/application.yml are loaded and used by the application as expected. All works fine. However, my problem is that I need these properties to be updatable as needed, so I need access to the application.yml file once on the Docker container. But at this point, it's not included in the build/docker/ directory before running the buildDocker task, so won't be copied over or accessible after first deployment. So, what I have

Externalising Spring Boot properties when deploying to Docker

笑着哭i 提交于 2019-11-26 20:10:34
问题 In my Spring Boot app I want to externalise the properties to run in a Docker container. When first deployed, the properties that are currently in my-server/src/main/resources/application.yml are loaded and used by the application as expected. All works fine. However, my problem is that I need these properties to be updatable as needed, so I need access to the application.yml file once on the Docker container. But at this point, it's not included in the build/docker/ directory before running