Skip to content

Using sec:authorize in JSPX causes 'java.lang.NullPointerException: Cannot invoke "jakarta.servlet.ServletRegistration.getClassName()" because "registration" is null' #15363

Closed
@zverde

Description

@zverde

Hello,

We are encountering an issue with the sec:authorize expression in JSPX files after upgrading to Spring Security 6.
We've created a simple Spring Boot application to reproduce the exception:
jsp-demo.zip

  • In example.jspx, the sec:authorize expression is used.
  • When accessing the URL http://localhost:8080/jsp-demo/, the following exception is thrown:
java.lang.NullPointerException: Cannot invoke "jakarta.servlet.ServletRegistration.getClassName()" because "registration" is null
	at org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry$DispatcherServletRequestMatcher.matches(AbstractRequestMatcherRegistry.java:514) ~[spring-security-config-6.3.1.jar:6.3.1]
	at org.springframework.security.web.util.matcher.OrRequestMatcher.matches(OrRequestMatcher.java:58) ~[spring-security-web-6.3.1.jar:6.3.1]

Is there something missing in our configuration, or is this a bug?

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configtype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions