Questions tagged [spring-boot-2]
111 questions
19
votes
4 answers
Live reload for thymeleaf template
When I change a thymeleaf .html file residing inside /templates , I expect the browser to automatically reload the page. I have the live reload plugin installed and its able to do a handshake with the spring boot server. However , upon chaning a…

Rpant
- 974
- 2
- 14
- 37
18
votes
5 answers
401 instead of 403 with Spring Boot 2
With Spring Boot 1.5.6.RELEASE I was able to send HTTP Status code 401 instead of 403 as described in How let spring security response unauthorized(http 401 code) if requesting uri without authentication, by doing this:
public class SecurityConfig…

lealceldeiro
- 14,342
- 6
- 49
- 80
17
votes
4 answers
Prometheus config doesn't work with Spring boot 2.3.0: ClassNotFoundException: io.micrometer.prometheus.HistogramFlavor
Application was working correctly with version 2.2.6 but as the application is upgraded to latest version of spring boot 2.3.0 it stopped working and fails during startup.
2020-05-20T08:43:04.408+01:00 [APP/PROC/WEB/0] [OUT] 2020-05-20 07:43:04.407…

Krushnat Khavale
- 416
- 2
- 4
- 14
9
votes
1 answer
Spring Boot actuator "system.cpu.usage" vs "process.cpu.usage"
I am using spring boot 2.3.2. With help of actuator, publishing the application metrics to metrics console. I would like to know what is the difference between system.cpu.usage and process.cpu.usage metrics polished by the actuator.

Manu
- 3,467
- 3
- 29
- 28
8
votes
2 answers
Configuring caching for Hibernate with Spring Boot 2.1+
Context and question
I'm trying to configure EHCache with Hibernate in Spring Boot 2.2, but it seems I'm doing something wrong.
I've looked at several tutorials and SO questions but didn't find something that matched fully my approach.
I chose the…

Chop
- 4,267
- 5
- 26
- 58
6
votes
3 answers
Is there a way to get list of loaded properties file in SpringBoot application?
I'm facing an issue on only one platform when I'm trying to execute mvn clean install. As part of the build we compile multiple component and last we execute functional testing using wiremock. It is supposed to pick specific configuration from…

cool_ravi
- 165
- 1
- 9
6
votes
2 answers
Spring-Boot 2.3.1 -Dspring-boot.run.arguments not working
I have been using mvn spring-boot:run command with -Dspring-boot.run.arguments to pass arguments/variables to our spring-boot application, ex:
mvn spring-boot:run -Dspring-boot.run.arguments=--jwt.validateExp=false,--jwt.skipValidation=true
And in…

Rajib Biswas
- 772
- 10
- 27
5
votes
1 answer
In Spring Boot 2, how can I auto-generate my database and also record the schema generation commands to a file?
I'm using Spring Boot 2.1 with Java 11. I am using Maven to build my artifacts. When running locally, I like the Spring JPA directives that let me create the database automatically ...
spring.jpa.properties.hibernate.dialect =…

satish
- 703
- 5
- 23
- 52
5
votes
1 answer
HikariCP vs. JDBC Metrics Spring Boot2
What is the difference between "hikaricp.connections." and "jdbc.connections." meter names? I have a Spring Boot 2 application that is defaulting to the Hikari connection pool mechanism and I am tring to understand how to best monitor the database…

Nick Marchessault
- 53
- 1
- 5
4
votes
0 answers
'Ambiguous search mapping detected.' exception is thrown when springfox-boot-starter 3.0.0 is implemented in Spring Boot 2.3.6
An 'java.lang.IllegalStateException: Ambiguous search mapping detected.' exception is thrown when I try to implement springfox-boot-starter 3.0.0 in Spring Boot 2.3.6.
I have two overloaded methods public abstract Collection abc(int) and public…

Man Dee
- 61
- 2
4
votes
1 answer
JPA - JpaRepository child record has parent id instead of entity record if parent already fetched
I'm still grasping JPA concepts and can't seem to find the answer to my question anywhere!
Assume
Both classes are annotated with @GeneratedValue(strategy = GenerationType.IDENTITY), There are all getters and setters.
Parent{
....
…

Olivier M.
- 51
- 6
4
votes
0 answers
How to catch all the exceptions in Spring boot 2 webflux with @ControllerAdvice
My application is made by Spring Boot 2 webflux and thymeleaf, I want to catch all the exception and render the error to a customized error page.
I use @ControllerAdvice and @ExceptionHandler to catch exceptions and handle errors in a central…

user2592010
- 41
- 1
- 3
3
votes
0 answers
Swagger not working with Spring-Boot after 2.7.0 upgrade
I upgraded Spring-Boot from version 2.5 to 2.7.
After trying multiple solutions, to make it run, I got to the point to be able to run and access the endpoints directly, like https://localhost:8493/test/myendpoint, it returns the json needed, but I…

Octavia
- 198
- 1
- 13
3
votes
2 answers
Spring Boot migration to 2.5/2.6 from 2.1 - Issue with SQL Script DataSource Initialization order
I'm migrating my existing Spring Boot 2.1.x application to 2.6.x. I want the following behavior (for integration tests which uses embedded H2 database), which is working fine in 2.1.x (obviously) but I'm struggling to achieve the same behavior in…

Dilip Raj Baral
- 3,060
- 6
- 34
- 62
3
votes
1 answer
How can I get the referrer URL in Spring Webflux?
How can I get the referrer URL in Spring Webflux?
I tried to look into the header attributes in ServerWebExchange exchange object but could not found the same.
Can someone please help me here.

Paras
- 3,191
- 6
- 41
- 77