aws / aws/serverless-java-container

ServletContextListener never invoked

Open
#505 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.6k
Forks
574
PR merge metrics
No merged PRs in 30d

Description

*Serverless Java Container version*: `1.9.1`

*Implementations:* `Spring Boot 2`

*Framework version:* `SpringBoot 2.7.5`

*Frontend service:* `HTTP API`

*Deployment method:* `SAM`

## Scenario
Hilla initializes some parts through a `ServletContextInitializer` that uses `servletContext.addListener` to add a `ServletContextListener` to the context. The actual initialization then takes place in the `ServletContextListener`. The problem is that the `addListener` method of `AwsServletContext` is empty.

Not sure where the correct place would be to invoke the listener. It seems to happen to work if I invoke the listener immediately.

## Expected behavior
The added listener is called

## Actual behavior
The added listener is ignored

Contributor guide

Open the contributing guide

Research direction

Start by inspecting AwsServletContext.addListener and the ServletContextInitializer and ServletContextListener lifecycle described in the issue. Trace how the AWS servlet context is created and determine where the registered listener should be invoked. Done means an added ServletContextListener is called during initialization without breaking the Spring Boot serverless startup path.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, spring-boot
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.