Skip to content

Upgrade to Spring 6.1 requires Servlet 6.0 (JEE 10) #34106

@rahulsh1

Description

@rahulsh1

During the upgrade to JEE9 and Spring 6.1, found some test issues that result in the following exception:

java.lang.NoSuchMethodError: 'java.lang.String org.springframework.mock.web.MockCookie.getAttribute(java.lang.String)
 at org.springframework.mock.web.MockCookie.getSameSite(MockCookie.java:98)
 at org.springframework.mock.web.MockHttpServletResponse.getCookieHeader(MockHttpServletResponse.java:485)
 at org.springframework.mock.web.MockHttpServletResponse.setCookie(MockHttpServletResponse.java:773)
 at org.springframework.mock.web.MockHttpServletResponse.setSpecialHeader(MockHttpServletResponse.java:739)
 at org.springframework.mock.web.MockHttpServletResponse.setHeaderValue(MockHttpServletResponse.java:697)
 at org.springframework.mock.web.MockHttpServletResponse.setHeader(MockHttpServletResponse.java:674)

After some digging, it appears that MockCookie is calling a Servlet 6.0 API that does not exist in Servlet 5.0

As per Spring-Framework-Versions#javajakarta-ee-versions, Spring Framework 6.1.x: Jakarta EE 9-10 (jakarta namespace)
mentions that Spring 6.1 is compliant is JEE9, however with this dependency for tests, it appears to be broken with requirement on Servlet 6.0

I do NOT see any mentions of requiring Servlet 6.0 in the Spring-Framework-6.1-Release-Notes.

This is the commit that introduced dependency on Servlet 6.

Is this a deliberate requirement, or was it simply an oversight?

Is it feasible to keep Spring 6.1 fully compatible with JEE9 (including tests), ensuring that users won’t face the additional challenge of upgrading to the JEE10 ecosystem?

This approach would significantly reduce the burden on consumers, allowing them to continue their work without the added complexity of transitioning to a newer, potentially disruptive platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions