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
128
votes
22 answers

Can't Autowire @Repository annotated interface in Spring Boot

I'm developing a spring boot application and I'm running into an issue here. I'm trying to inject a @Repository annotated interface and it doesn't seem to work at all. I'm getting this error org.springframework.beans.factory.BeanCreationException:…
visst
  • 1,351
  • 2
  • 11
  • 10
127
votes
23 answers

java.lang.IllegalArgumentException: No converter found for return value of type

With this code @RequestMapping(value = "/bar/foo", method = RequestMethod.GET) public ResponseEntity foo() { Foo model; ... return ResponseEntity.ok(model); } } I get the following…
Marc
  • 16,170
  • 20
  • 76
  • 119
127
votes
14 answers

Spring Boot default H2 jdbc connection (and H2 console)

I am simply trying to see the H2 database content for an embedded H2 database which spring-boot creates when I don't specify anything in my application.properties and start with mvn spring:run. I can see hibernate JPA creating the tables but if I…
Aaron Zeckoski
  • 5,016
  • 8
  • 25
  • 48
127
votes
27 answers

Spring boot Security Disable security

When I use security.basic.enabled=false to disable security on a Spring Boot project that has the following dependencies: org.springframework.boot spring-boot-starter-web
user3600073
  • 1,773
  • 3
  • 18
  • 21
126
votes
6 answers

Spring Boot 2.5.0 generates plain.jar file. Can I remove it?

After the Spring Boot 2.5.0 update, it generates the myprogram-0.0.1-plain.jar file alongside the usual myprogram-0.0.1.jar. Can I disallow gradle to generate the *.plain.jar file? I use Gradle 7.0.2. What I get: build/ libs/ …
Tien Do Nam
  • 3,630
  • 3
  • 15
  • 30
126
votes
9 answers

Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented

How can I solve this error: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)…
Sandeep Malviya
  • 1,399
  • 2
  • 8
  • 7
126
votes
6 answers

What is the recommended project structure for spring boot rest projects?

I'm a beginner with spring boot. I'm involved in the beginning of a project where we would build rest services using spring boot. Could you please advise the recommended directory structure to follow when building a project that will just expose…
chip
  • 3,039
  • 5
  • 35
  • 59
125
votes
17 answers

No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor

When i try to navigate to an endpoint i get the following error Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException:…
Ayoub k
  • 7,788
  • 9
  • 34
  • 57
125
votes
7 answers

Spring Boot Unit Test ignores logging.level

One of my maven module ignores my logging levels when running tests. In src/test/resources I have application.properties: app.name=bbsng-import-backend app.description=Import Backend Module for Application spring.profiles.active=test #…
Michael Hegner
  • 5,555
  • 9
  • 38
  • 64
125
votes
11 answers

Spring Boot application.properties value not populating

I have a very simple Spring Boot app that I'm trying to get working with some externalised configuration. I've tried to follow the information on the spring boot documentation however I'm hitting a road block. When I run the app below the external…
grahamrb
  • 2,159
  • 2
  • 15
  • 22
125
votes
9 answers

Spring Boot and how to configure connection details to MongoDB?

Being new to Spring Boot I am wondering on how I can configure connection details for MongoDB. I have tried the normal examples but none covers the connection details. I want to specify the database that is going to be used and the url/port of the…
Marco
  • 15,101
  • 33
  • 107
  • 174
124
votes
11 answers

Overriding beans in Integration tests

For my Spring-Boot app I provide a RestTemplate though a @Configuration file so I can add sensible defaults(ex Timeouts). For my integration tests I would like to mock the RestTemplate as I dont want to connect to external services - I know what…
mvlupan
  • 3,536
  • 3
  • 22
  • 35
123
votes
26 answers

Remove "Using default security password" on Spring Boot

I added one custom Security Config in my application on Spring Boot, but the message about "Using default security password" is still there in LOG file. Is there any to remove it? I do not need this default password. It seems Spring Boot is not…
Carlos Alberto
  • 7,761
  • 13
  • 52
  • 72
123
votes
14 answers

How to customise the Jackson JSON mapper implicitly used by Spring Boot?

I'm using Spring Boot (1.2.1), in a similar fashion as in their Building a RESTful Web Service tutorial: @RestController public class EventController { @RequestMapping("/events/all") EventList events() { return…
Jonik
  • 80,077
  • 70
  • 264
  • 372
123
votes
9 answers

Spring Boot JPA - configuring auto reconnect

I have a nice little Spring Boot JPA web application. It is deployed on Amazon Beanstalk and uses an Amazon RDS for persisting data. It is however not used that often and therefore fails after a while with this kind of…
stoffer
  • 2,317
  • 2
  • 18
  • 24