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
19
votes
6 answers

Wrong "Generated server url" in springdoc-openapi-ui (Swagger UI) deployed behind proxy

Spring Boot 2.2 application with springdoc-openapi-ui (Swagger UI) runs HTTP port. The application is deployed to Kubernetes with Ingress routing HTTPS requests from outside the cluster to the service. In this case Swagger UI available at…
Eugene Khyst
  • 9,236
  • 7
  • 38
  • 65
19
votes
2 answers

AuthorizationServerConfigurerAdapter is deprecated

I'd like to use Oauth2 authentication in spring rest API for login. But I got some warning like AuthorizationServerConfigurerAdapter is deprecated and see the OAuth 2.0 Migration Guide for Spring Security 5. I checked there but not found a much…
19
votes
5 answers

Proxy setting not working with Spring WebClient

My following WebClient is working fine with internet connection but not through our proxy connection. WebClient webClient = WebClient.builder() .baseUrl("https://targetsite.com") .build(); webClient.post() …
Krishna
  • 609
  • 1
  • 6
  • 17
19
votes
3 answers

Spring Data / Hibernate save entity with Postgres using Insert on Conflict Update Some fields

I have a domain object in Spring which I am saving using JpaRepository.save method and using Sequence generator from Postgres to generate id automatically. @SequenceGenerator(initialValue = 1, name = "device_metric_gen", sequenceName =…
abstractKarshit
  • 1,355
  • 2
  • 16
  • 34
19
votes
10 answers

How to convert from application.properties to application.yml in Spring Boot?

I have a very simple Spring Boot app and I have application.properties, and now I want to move to application.yml This is the application.yml file: spring: datasource: url: jdbc:mysql://localhost:3306/employee_directory username:…
user9608350
19
votes
2 answers

JUnit 5: Inject spring components to Extension (BeforeAllCallback / AfterAllCallback)

tl;dr: How can I instantiate a custom data provider as a Spring component before all tests run? Is there a smart way to inject Spring components into a custom JUnit Jupiter extension that implements BeforeAllCallback? The beforeAll method should…
froehli
  • 904
  • 1
  • 11
  • 35
19
votes
4 answers

Spring boot Swagger implementation using Spring Fox Failed to start bean 'documentationPluginsBootstrapper'

I am using the Springfox jars for implementation of swagger in my spring boot project the gradle dependencies look like: dependencies { compile group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: '2.1.3.RELEASE' compile…
vaibhav
  • 3,929
  • 8
  • 45
  • 81
19
votes
3 answers

How do constructor calls with @Autowired work?

I'm learning the Spring Boot framework and I want to understand how the @Autowired annotation works. I know that in Spring Boot we have a context, and inside that context there are beans which can be connected to each other by the @Autowired…
GJCode
  • 1,959
  • 3
  • 13
  • 30
19
votes
4 answers

A default binder has been requested, but there are no binders available for 'org.springframework.cloud.stream.messaging.DirectWithAttributesChannel'

I am trying to create the simplest as possible hello world with Spring Cloud + Kafka Streams + Spring Boot 2. I realize I miss basic concepts. Basically, I understand that: 1 - I need to define an outbound stream to write messages to a Kafka topic,…
Jim C
  • 3,957
  • 25
  • 85
  • 162
19
votes
1 answer

How to configure service provider with spring-security-saml2 to consume EncryptedAssertions?

I am using this excellent repo vdenotaris/spring-boot-security-saml-sample as a guide and I am trying to set it up to verify and decrypt incoming SAML messages that contain EncryptedAssertion. The idP's metadata defines the signing and encrypting…
george_h
  • 1,562
  • 2
  • 19
  • 37
19
votes
2 answers

Spring multiple authentication methods for different api endpoints

I want to check for different authentication methods for different endpoints. Methods i want to use are x509 and jwt. I need to use only x509 for certain endpoint and use JWT for all other requests. Here's my web security…
Çağdaş Salur
  • 1,360
  • 3
  • 14
  • 24
19
votes
2 answers

AuthenticationFailed to mongoDB with Spring boot

I'm trying to create a server where my webpage / app can make calls, from now I'm starting with Login so, I've created the Server according my needs, the problem is on application.properties that I'm missing something, I have this :…
StuartDTO
  • 783
  • 7
  • 26
  • 72
19
votes
1 answer

Controller mapping are not logging at startup

I have a requirement to upgrade the existing code which runs on jdk 8 to jdk 11 After upgrading it the controller mappings are not showing up during startup.In this application we have defined some inbound gateways for integration and we have also…
Sid
  • 255
  • 2
  • 12
19
votes
8 answers

Inferred type 'S' for type parameter 'S' is not within its bound; should extend 'ua.com.store.entity.Country

I have a problem with my CountryServiceImpl,when I want realize method findOne in CountryServiceImpl it tells me "Inferred type 'S' for type parameter 'S' is not within its bound; should extend 'ua.com.store.entity.Country". I wanted to fix by…
Roman Sychok
  • 319
  • 1
  • 2
  • 7