Skip to content

Java 21 support for swagger-core? #4765

@rasikaghadge

Description

@rasikaghadge

I updated my application to support java 21. In that, all the javax.servlet.* imports were changed to jakarta. After this, I started seeing this error in swagger:
Failed to load API definition: response status is 500 /aps/openapi/openapi.json

The application logs are showing this error:
org.apache.catalina.core.StandardWrapperValve.invoke Allocate exception for servlet [OpenApi]
java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet

Similarly, I updated my application to use jakarta.xml.bind-api version 4.0.2 (which was 2.3.5 previously)

I found that the latest release of swagger-core currently relies on jakarta.xml.bind-api=2.3.3. Reverting my application back to this dependency version and imports resolves the issue.

However, moving forward, my application requires these changes. Could you let me know if there are plans to provide support for java 21, or if there's an alternative approach that would allow this compatibility?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions