question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for Jakarta EE

See original GitHub issue

Is your feature request related to a problem? Please describe. When using springdoc-openapi-ui, one gets a dependency to the old javax-apis through the version of swagger-core that is included (via springdoc-common).

Describe the solution you’d like It seems swagger has solved this by publishing separate artifacts suffixed with jakarta (See https://github.com/swagger-api/swagger-core/pull/3881). It would be nice if one could do the same with springdoc, or if possible solve it in some other way, so as not have to manually exclude the javax-swagger-versions and include the jakarta-swagger versions a la

implementation(
  'io.swagger.core.v3:swagger-annotations-jakarta:2.1.11',
  'io.swagger.core.v3:swagger-integration-jakarta:2.1.11',
  'io.swagger.core.v3:swagger-models-jakarta:2.1.11'
)

implementation('org.springdoc:springdoc-openapi-ui:1.5.11') {
  exclude(group: 'io.swagger.core.v3', module: 'swagger-annotations')
  exclude(group: 'io.swagger.core.v3', module: 'swagger-integration')
  exclude(group: 'io.swagger.core.v3', module: 'swagger-models')
}

I’m not well enough versed in all the possibilities of configuring dependencies in maven to come up with the best solution to this, but it would be nice if it could be solved somehow, as jakarta.* is where the development will continue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:9
  • Comments:27 (10 by maintainers)

github_iconTop GitHub Comments

12reactions
goafabriccommented, Jan 22, 2022

just found this issue after upgrading to Spring Boot 3.0 M1 … OpenAPI crashes by trying to use Reflection for javax Classes (like Servlet) … which our now gone / replaced by the jakarta ee namespace …

SpringDoc Version is 1.6.4

at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:461) ~[spring-core-6.0.0-M2.jar:6.0.0-M2]
... 90 common frames omitted

Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[na:na]

10reactions
bnasslahsencommented, Jan 27, 2022

Hi @goafabric,

The support has been added in springdoc-openapi 2 branch. For now we will Support Jakarta EE 9 and Spring-Boot 3. springdoc-openapi v2 will require Java 17as a minimum version and Spring Boot 3.x springdoc-openapi v2 will be released once spring-Boot 3 goes G.A.

This is the link for the demos code:

If you want to give it a try, this is a first version of the documentation updated here:

And this is the migration steps:

Note: spring-cloud and spring-native are not yet ready for spring-boot 3 support.

Please feel free to use and test the latest SNAPSHOT: springdoc-openapi v2.0.0-SNAPSHOT.

   <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
      <version>2.0.0-SNAPSHOT</version>
   </dependency>

Don’t hesitate to provide your comments in this ticket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jakarta® EE | Cloud Native Enterprise Java | Java EE | the ...
Jakarta Enterprise Edition (EE) is the open source future of cloud native enterprise Java. Protect your investments in Java EE and modernize your...
Read more >
Jakarta EE 9 Release | Java EE 9 | The Eclipse Foundation
The Jakarta EE 9 release is here, the future of Java EE. Download compatible products and see what's new in the specifications.
Read more >
Jakarta EE and Java EE 8 in Liberty - IBM
Liberty supports the full Java Platform, Enterprise Edition (Java EE) 8, which provides a number of improvements over previous Java EE versions.
Read more >
Add support for Jakarta EE 9.1 · Issue #111 · eclipse-ee4j/starter
Add support for Jakarta EE 9.1 #111 ; enhancement New feature or request ; high-priority High priority issue ; in-progress Being worked on...
Read more >
The Jakarta® EE Tutorial
The proven portability, security, and developer productivity they provide form the basis of the application model. Jakarta EE is designed to support ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found