spring-projects / spring-projects/spring-security-samples

Servlet sample not working in Tomcat 10 and 11

Open
#345 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.8k
Forks
797
Avg merge
3m
Merged PRs (30d)
5

Description

I tried to run the sample in servlet/java-configuration/hello-security-explicit on Tomcat 10 and Tomcat 11 . But no luck. It seems that SecurityWebApplicationInitializer is not called ( I am using maven to get project libs)

To debug further, I try to print the list of application filters ( by using context.getFilterRegistrations() ) but the spring filters are not shown.

My web.xml:

<web-app
    xmlns="https://jakarta.ee/xml/ns/jakartaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
    version="6.0"
    >
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
	</listener>
</web-app>

Am I missing something ?! Is this sample suppose to be run on Tomcat whiteout any changes ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the servlet/java-configuration/hello-security-explicit sample and its web.xml, then deploy it on Tomcat 10 and Tomcat 11 using the Maven-provided libraries. Check whether SecurityWebApplicationInitializer runs and whether the Spring filters appear in context.getFilterRegistrations(); done means the sample starts and its security filters are registered without undocumented changes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.