Skip to content

ApplicationContextException: Unable to start ServletWebServerApplicationContext #326

Closed
@boroda4436

Description

@boroda4436
  • Framework version: aws-cli/2.0.0dev4 Python/3.7.4 Darwin/19.2.0 botocore/2.0.0dev3
  • Implementations: Spring Boot

Scenario

Run the spring-boot2 app locally

Expected behavior

the app starts without exceptions

Actual behavior

error happens:

image

Steps to reproduce

  1. Download the repo
  2. cd samples/springboot2/pet-store
  3. Run com.amazonaws.serverless.sample.springboot2.Application from your IDE as a simple spring-boot app.

Full log output

2020-02-26 15:57:01.303 INFO 59255 --- [ main] c.a.s.sample.springboot2.Application : Starting Application on Bogdans-MBP.mate.academy with PID 59255 (/Users/bchupika/IdeaProjects/Study/aws-serverless-java-container/samples/springboot2/pet-store/target/classes started by bchupika in /Users/bchupika/IdeaProjects/Study/aws-serverless-java-container)
2020-02-26 15:57:01.312 INFO 59255 --- [ main] c.a.s.sample.springboot2.Application : No active profile set, falling back to default profiles: default
2020-02-26 15:57:02.082 ERROR 59255 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
at com.amazonaws.serverless.sample.springboot2.Application.main(Application.java:47)
Caused by: org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getWebServerFactory(ServletWebServerApplicationContext.java:203)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:179)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:153)
... 8 common frames omitted

Process finished with exit code 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions