I am currently working on the localization of my (second) Spring Boot project. However, I have come to a halt after several hours of struggling: I am unable to get a user-editable Session localization. The problem appears to occur as soon as the user sends a GET request with the lang parameter. (travel down b…
Tag: spring-boot
Refreshing configurations of microservices based on messaging topic
I have a spring cloud configserver in place and we are using s3 as a version control. I have activemq for sending topics which will later be consumed by the microservices. Now we need to refresh the configuration of microservices depending upon the value of the topic which we send in activemq. Lets say we onl…
No qualifying bean of type ‘org.springframework.boot.actuate.metrics.MetricsEndpoint’
I upgraded spring.version from 5.0.18.RELEASE to 5.3.21 and spring.boot.version from 2.1.18.RELEASE to 2.7.0 spring-boot-starter-actuator ${spring.boot.version} In my Healthcheck class I use: After upgrade I’ve got: Why Spring doesn’t see org.springframework.boot.actuate.metrics.MetricsEndpoint ? …
In which database JpaRepository uses by default?
When we using methods that come from JpaRepository like save, in which database spring boot use? and how can we change the default database if necessary? Answer It uses the database which you have configured in your properties file. You can change the database using the following properties(MySQL example):
spring boot app works on intellij but not with .jar file
I am new to Spring boot and java. I have a simple Spring boot app which has one function. When I run it on intellij it works well, and I am able to test it with postman many times without issue. But when I build an artifact and then .jar file, running that .jar file will close the program immediately.
How To Convert Spring Boot Entity to Angular Object
I’m trying to use Angular and Spring Boot to show a list of Rule objects. I am not using a JPA Repository to respond to the GET request, so I think I have to ‘manually’ convert my list of Rule objects on the Spring Boot side to a JSON so that httpClient.get<Rule[]>() can convert it to …
NoSuchBeanDefinitionException with reactive mongo repository: required a bean of type that could not be found
I have an issue: repository bean couldn’t be found when it’s placed in outer package. It causes nested UnsatisfiedDependencyException which is due to NoSuchBeanDefinitionException (expected at least 1 bean which qualifies as autowire candidate). After I copied the class to my project, it works per…
Why handleResponse(URI url, HttpMethod method, ClientHttpResponse response) method of RestTemplate.class is getting called for a 200 Succeess response
I am calling an external API from my code using RestTemplate like below: This API call is returning 200 Success but when I debug it, it still goes to handleResponse(URI url, HttpMethod method, ClientHttpResponse response) method of RestTemplate.class And then it’s coming to my RestTemplateErrorHandler.j…
SWAGGER – Fetch error v2/apidocs undefined
My swagger was working fine with this code. I wanted to add Authorize option in swagger page. So I did this config. From the time I added this new configurations I am getting this error. I have added the v2/api-docs in my security web ignore & http disble configurations already. My swagger dependencies: p…
Swagger/Openapi – How to document imported modules in a Spring boot project?
I have an authentication module which is imported inside our projects to provide authentication related APIs. AppConfig.java I’ve configured Swagger/OpenAPI in my projects and I wish to find a way to manage these imported endpoints: Specifically, I wish to set an order on the Example object’s fiel…