Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display auto-configuration report when running a Spring Boot application

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled

I am getting the above message when I try to run my Spring Boot application.

Does anyone know how I can re-run the application with 'debug' enabled?

I am running the application in Intellij (version 2016.1.2)

My runner class looks like the following,

@Slf4j @EnableIntegration @EnableLoaderApplication @SpringBootApplication public class LoaderApplicaton {      public static void main(final String[] args) {         SpringApplication.run(LoaderApplicaton.class, args);     } } 

In response to Darren's answer below, I amended my properties.yml file as follows and that produced the auto-configuration report,

debug: true spring:   application:     name: xxxMyLoaderApp   cloud:     config:       uri: http://my-host.address.com:8761/config 
like image 434
robbie70 Avatar asked Nov 03 '17 17:11

robbie70


People also ask

How do you check autoconfiguration in spring boot?

Report OutputThe auto-configuration report contains information about the classes that Spring Boot found on the classpath and configured automatically. It also shows information about classes that are known to Spring Boot but were not found on the classpath.

How is auto-configuration done in spring boot?

You need to opt-in to auto-configuration by adding the @EnableAutoConfiguration or @SpringBootApplication annotations to one of your @Configuration classes. You should only ever add one @EnableAutoConfiguration annotation. We generally recommend that you add it to your primary @Configuration class.

Does spring boot support auto-configuration?

Simply put, the Spring Boot auto-configuration helps us automatically configure a Spring application based on the dependencies that are present on the classpath. This can make development faster and easier by eliminating the need to define certain beans included in the auto-configuration classes.

How do I get auto configuration report in Spring Boot?

4. Command-Line Approach Or, if we don't want to use the properties file approach, we can trigger the auto-configuration report by starting the application with the –debug switch: 5. Report Output The auto-configuration report contains information about the classes that Spring Boot found on the classpath and configured automatically.

What does @springbootapplication=@componentscan+@enableautoconfiguration mean?

@SpringBootApplication=@ComponentScan+@EnableAutoConfiguration+@Configuration When we add the spring-boot-starter-web dependency in the project, Spring Boot auto-configuration looks for the Spring MVC is on the classpath. It auto-configures dispatcherServlet, a default error page, and web jars.

What is Spring-Boot-autoconfigure jar?

‘spring-boot-autoconfigure.jar’ is the file that looks after all the auto-configuration. All auto-configuration logic for MVC, data, JMS, and other frameworks is present in a single jar Auto-Configuration is the main focus of the Spring Boot development. Our Spring application needs a respective set of dependencies to work.

How to create a debug report in Spring Boot?

But, we can have Spring Boot create a report simply by enabling debug mode in our application.properties file: 4. Command-Line Approach Or, if we don't want to use the properties file approach, we can trigger the auto-configuration report by starting the application with the –debug switch: 5. Report Output


1 Answers

Set debug = true or debug: true in your properties/yml. It can also be passed as an argument --debug.

There are further details available in the Spring Boot documentation on what the debug flag does.

https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-console-output

like image 162
Darren Forsythe Avatar answered Sep 20 '22 12:09

Darren Forsythe