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
3 answers

SpringBoot - Error parsing HTTP request header

I am running SpringBoot Application just checked server logs and got several errors like this. I can't understand what can cause it as the error appears everyday after 12/24 hours. Tomcat Version running on 8.5.11 2018-03-04 17:03:26…
Mikheil Janiashvili
  • 497
  • 1
  • 6
  • 18
19
votes
4 answers

Spring Boot JDBC Template SQL Log

I am trying log SQL queries with params for Spring Boot JDBC but it is not printing the details in log.I am using Spring Boot 1.5.8 version.Please help me to solve…
sunleo
  • 10,589
  • 35
  • 116
  • 196
19
votes
1 answer

Trouble with Fetch in React with CORS

I'm completely new to CORS and i'm having the following issue: -I'm using create-react-app (port 3000) that invokes some REST Services made in spring boot (port 8080). I added JWT auth to my REST API so now i have to authenticate before i call…
J_Ocampo
  • 445
  • 1
  • 7
  • 18
19
votes
4 answers

ElasticSearch health check failed every time when spring boot start up

I am working with Elastic Search 5.5.0 on Spring boot 1.5.8.RELEASE using the Java Transport Client library. The Elastic Search was deployed with docker in a container. It works well. The queries from my java application works well too. The problem…
RobinZheng
  • 301
  • 1
  • 2
  • 9
19
votes
2 answers

Spring boot ComponentScan excludeFIlters not excluding

I am having a SimpleTest : @RunWith(SpringRunner.class) @SpringBootTest(classes = SimpleTestConfig.class) public class SimpleTest { @Test public void test() { assertThat(true); } } and a configuration for this test :…
Daniel Taub
  • 5,133
  • 7
  • 42
  • 72
19
votes
6 answers

How to throw an exception back in JSON in Spring Boot

I have a Request Mapping - @RequestMapping("/fetchErrorMessages") public @ResponseBody int fetchErrorMessages(@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime) throws Exception { …
Prateek Narendra
  • 1,837
  • 5
  • 38
  • 67
19
votes
1 answer

IntelliJ: How to set log levels for tests

I have a problem with test console output in IntelliJ 2016. When I run JUnit tests via IntelliJ, the console window is flooded with enormous amounts of log lines, for example DEBUG reactor.ipc .... DEBUG io.netty.buffer.ByteBufUtil .... It's a…
feob
  • 1,930
  • 5
  • 19
  • 31
19
votes
2 answers

Passing env variables to DOCKER Spring Boot

I have a SpringBoot application and its Dockerfile is as follows. I have application.properties for different environments like local/dev/qa/prod. When I run the application locally in IDE, I pass -Dspring.profiles.active=local in VM options so that…
deejo
  • 431
  • 2
  • 7
  • 13
19
votes
4 answers

Disable intellij springboot dashboard

Intellij now comes with a springboot dashboard. I have been brave enough to enable it, but now I want to disable it because it confuses me. Where do I find the settings? In settings I see nothing
19
votes
6 answers

Spring Boot: @Value returns always null

I would like to use a value from application.properties file in order to pass it in the method in another class. The problem is that the value returns always NULL. What could be the problem? Thanks in…
Jonathan Williams
  • 237
  • 1
  • 4
  • 12
19
votes
2 answers

Storing java 8 LocalDate in mongo DB

Using Spring Boot 1.5.4.RELEASE and Mongo driver 3.4.2. I want to store LocalDate in mongo DB, but I am facing a weird problem: LocalDate startDate = LocalDate.now(); LocalDate endDate = LocalDate.of(2020,12,01); System.out.println("---- StartDate :…
Mehraj Malik
  • 14,872
  • 15
  • 58
  • 85
19
votes
3 answers

Elasticsearch Rest Client with Spring Data Elasticsearch

I am in a situation where I am using Spring boot and AWS elasticsearch service. AWS Elasticsearch service which only provides REST interface. Elasticsearch Rest Client is here. Simply, Is it possible to use REST client with Spring Data…
19
votes
4 answers

List final list of properties - Spring Cloud Config Server

Spring Cloud Config Server accepts multiple profile and returns the properties for all the profiles when I access the /env endpoint of the application. The response lists the properties specific to each profile. If same property is present in 2…
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
19
votes
4 answers

How to disable console logging in spring-boot?

I'm using the default logging configuration of spring-boot. How can I prevent the console output, while keeping the logging into a logfile configured with logging.file=myfile.log? My goal is to not having console windows output, but only logging to…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
19
votes
6 answers

Spring boot test @Transactional not saving

I'am trying to do a simple Integration test using Spring Boot Test in order to test the e2e use case. My test does not work because I'am not able to make the repository saving data, I think I have a problem with spring contexts ... This is my…
Hedi Ayed
  • 371
  • 2
  • 3
  • 12
1 2 3
99
100