question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-configuration report not displayed if EmbeddedServletContainerFactory fails

See original GitHub issue

In the process of trying to replace Tomcat with Undertow in a new application, I copied and pasted the standard Maven exclusion and Undertow starter dependency to my POM. My application is failing to launch, however, with this error:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) ~[spring-context-4.3.7.RELEASE.jar:4.3.7.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) [spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at com.artsquare.workshop.launcher.WorkshopLauncher.main(WorkshopLauncher.groovy:13) [classes/:na]
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:189) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:134) ~[spring-boot-1.5.2.RELEASE.jar:1.5.2.RELEASE]
	... 8 common frames omitted

I figured this was probably some sort of classpath bug on my part, so I added --debug to turn on the auto-configuration report–but it does not display in this case.

Expected behavior: I see the report (and can use it to trace the conditions on the embedded servlet factories).

Actual behavior: The report is not printed when the application bails at the initial context refresh.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chryliscommented, May 14, 2017

I finally figured out what I think happened. The Eclipse file watcher noticed the POM had been updated while I was running something from the CLI, and so I got competing file downloads. The actual one that got saved was fine, but maybe Eclipse had a file handle open to a copy that got munged. Weird root cause, but it would be great if a backstop could still be added for the reporting.

0reactions
zhujiejuncommented, May 16, 2017

@chrylis Can you share you project?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to prevent spring-boot autoconfiguration for spring-web?
A SpringApplication changes its ApplicationContext class depending on whether it thinks it needs a web application or not. The first thing you can...
Read more >
Display Auto-Configuration Report in Spring Boot - Baeldung
The auto-configuration mechanism in Spring Boot attempts to automatically configure an application based on its dependencies.
Read more >
Spring Boot Reference Guide
If no failure analyzers are able to handle the exception, you can still display the full auto-configuration report to better understand what went...
Read more >
Spring boot enable debug logging - Java Developer Zone
In this article, We will see spring boot enable debug logging or how to see more informative console while starting spring boot application ......
Read more >
Displaying progress of Spring application startup in web browser
Web proxy (if any) in front of your application notices that it's down and display "friendly" error message; The website takes forever to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found