Questions tagged [spring-boot]

Use the Spring Boot tag for questions related to spring boot framework and the features it brings to your Web application. This includes questions about configuration, embedding of the Web servers, setting up metrics, health checks, externalized configuration etc. It does not include questions about the Web server itself, Java code running in your application, or standard spring components. Tag these questions with its own tags to get the best response!

Spring Boot makes it very easy to create a Spring-powered application with a minimum amount of work. An application created with Spring Boot (you can quickly do it using Spring Initializr) can be:

  • Created without a single line of configuration,
  • Created without any requirement of an application server because Spring Boot provides an application server (Embed , or ).
  • Largely autoconfigured with some sensible defaults and opinionated starter POMs to simplify your configuration,
  • Provide production-ready features such as metrics, health checks, and externalized configuration.

Spring Boot consists of several (optional) modules

Spring Boot CLI

A command line interface, based on , for starting/stopping Spring Boot created applications.

Spring Boot Core

The base for other modules, but it also provides some functionality that can be used on its own, eg. using command line arguments and files as Spring Environment property sources and automatically binding environment properties to Spring bean properties (with validation).

Spring Boot Autoconfigure

Module to autoconfigure a wide range of Spring projects. It will detect the availability of certain frameworks ( , , , ). When detected it will try to automatically configure that framework with some sensible defaults, which in general can be overridden in an application.properties/.yml file.

Spring Boot Actuator

This project, when added, will enable certain enterprise features (Security, Metrics, Default Error pages) to your application. Like the auto configure module it uses autodetection to detect certain frameworks/features of your application.

Spring Boot Starters

Different quickstart projects to include as a dependency in your or build file. It will have the needed dependencies for that type of application. Currently, there are starter projects for a web project ( and based), , , , exist. Many more have been added over the years and the full list can be found here.

Spring Boot Tools

The and build tool, as well as the custom Spring Boot Loader (used in the single executable jar/war), is included in this project.

143171 questions
110
votes
2 answers

Maximum (client request) thread pool size in spring

I am developing application server using spring boot app but now I want to know what is the default maximum (client request) thread pool size in spring and how can I customize that value?
sagar
  • 1,269
  • 2
  • 10
  • 10
109
votes
5 answers

POSTing a @OneToMany sub-resource association in Spring Data REST

Currently I have a Spring Boot application using Spring Data REST. I have a domain entity Post which has the @OneToMany relationship to another domain entity, Comment. These classes are structured as follows: Post.java: @Entity public class Post { …
ccampo
  • 1,483
  • 3
  • 12
  • 14
109
votes
2 answers

HttpSecurity, WebSecurity and AuthenticationManagerBuilder

Could anyone explain when to override configure(HttpSecurity), configure(WebSecurity) and configure(AuthenticationManagerBuilder)?
user3488241
  • 1,101
  • 2
  • 8
  • 4
108
votes
23 answers

Error "TestEngine with ID 'junit-vintage' failed to discover tests" with Spring Boot 2.2

I have a simple app using Spring Boot and Junit 5: When using Spring Boot 2.1 (e.g, 2.1.8 or 2.1.12), my unit tests run smoothly When using Spring Boot 2.2 (e.g., 2.2.2.RELEASE or 2.3.2.RELEASE) my unit tests fail with error message [ERROR]…
Ivan dal Bosco
  • 3,233
  • 4
  • 19
  • 24
106
votes
15 answers

Spring Boot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'

I'm trying to initiate a Spring Boot project using OpenJDK 15, Spring Boot 2.6.0, Springfox 3. We are working on a project that replaced Netty as the web server and used Jetty instead, because we do not need a non-blocking environment. In the code…
jvacaq
  • 1,429
  • 2
  • 12
  • 19
106
votes
6 answers

How to do bulk (multi row) inserts with JpaRepository?

When calling the saveAll method of my JpaRepository with a long List from the service layer, trace logging of Hibernate shows single SQL statements being issued per entity. Can I force it to do a bulk insert (i.e. multi-row) without needing…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
106
votes
13 answers

Table 'DBNAME.hibernate_sequence' doesn't exist

I have a SpringBoot 2.0.1.RELEASE application using spring data / jpa org.springframework.boot spring-boot-starter-data-jpa But when I do an update in the Amazon Aurora…
en Peris
  • 1,537
  • 12
  • 31
  • 63
105
votes
5 answers

Cannot get maven project.version property in a Spring application with @Value

How to get the maven project.version property in a Spring Boot application with a @Value annotation?
Jack G.
  • 3,681
  • 4
  • 20
  • 24
104
votes
13 answers

Swagger TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body

I have added Swagger to my Spring Boot 2 application: This is my Swagger config: @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket api() { // @formatter:off return new…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
104
votes
3 answers

Spring Boot embedded HornetQ cluster not forwarding messages

I'm trying to create a static cluster of two Spring Boot applications with embedded HornetQ servers. One application/server will be handling external events and generating messages to be sent to a message queue. The other application/server will be…
ci_
  • 8,594
  • 10
  • 39
  • 63
104
votes
12 answers

How can I override Spring Boot application.properties programmatically?

I have jdbc property files which I take from external configuration web-service In spring boot in order to set mysql props it's easy as adding those to…
rayman
  • 20,786
  • 45
  • 148
  • 246
104
votes
8 answers

how to disable spring boot logo in stdout?

Is there a way to disable the lovely but very visible ASCII Spring boot logo : . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' …
Fabien Benoit-Koch
  • 2,784
  • 2
  • 21
  • 33
104
votes
11 answers

Spring boot @ResponseBody doesn't serialize entity id

Have a strange problem and can't figure out how to deal with it. Have simple POJO: @Entity @Table(name = "persons") public class Person { @Id @GeneratedValue private Long id; @Column(name = "first_name") private String…
Konstantin
  • 1,057
  • 2
  • 7
  • 8
103
votes
6 answers

What is difference between @RequestBody and @RequestParam?

I have gone through the Spring documentation to know about @RequestBody, and they have given the following explanation: The @RequestBody method parameter annotation indicates that a method parameter should be bound to the value of the HTTP request…
103
votes
11 answers

How to specify prefix for all controllers in Spring Boot?

I have controller mappings to /user and /order: @RestController @RequestMapping("/users") public class UserController { ... } @RestController @RequestMapping("/orders") public class OrderController { ... } I want to access these by URL at…
Murali
  • 3,412
  • 5
  • 36
  • 34