You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SpringDoc swagger-ui.html returns 404 / Whitelabel Error Page when large resource files are present (eg 7 files of ~380Mb each). This is occuring after building and running the JAR file. The endpoint works fine when the project is run directly from Intellij.
(Note: I opened this issue with the springdoc team. They said this is actually a bug in webjars-locator - see discussion here: springdoc/springdoc-openapi#1249)
The logs show:
19:30:49.012 [http-nio-8080-exec-2] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 14 ms
19:30:49.023 [http-nio-8080-exec-2] TRACE o.s.web.servlet.DispatcherServlet - GET "/swagger-ui.html", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
19:30:49.026 [http-nio-8080-exec-2] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to org.springdoc.webmvc.ui.SwaggerWelcomeWebMvc#redirectToUi(HttpServletRequest)
19:30:49.036 [http-nio-8080-exec-2] TRACE o.s.web.method.HandlerMethod - Arguments: [org.apache.catalina.connector.RequestFacade@5e68b13]
19:30:49.064 [http-nio-8080-exec-2] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Using 'application/json;q=0.8', given [text/html, application/xhtml+xml, image/avif, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.9, */*;q=0.8] and supported [application/json, application/*+json, application/json, application/*+json]
19:30:49.064 [http-nio-8080-exec-2] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Nothing to write: null body
19:30:49.065 [http-nio-8080-exec-2] TRACE o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Applying default cacheSeconds=-1
19:30:49.065 [http-nio-8080-exec-2] TRACE o.s.web.servlet.DispatcherServlet - No view rendering, null ModelAndView returned.
19:30:49.065 [http-nio-8080-exec-2] DEBUG o.s.web.servlet.DispatcherServlet - Completed 302 FOUND, headers={masked}
19:30:49.071 [http-nio-8080-exec-3] TRACE o.s.web.servlet.DispatcherServlet - GET "/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
19:30:49.073 [http-nio-8080-exec-3] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/swagger-ui*/**, /**]
19:30:49.073 [http-nio-8080-exec-3] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler [Classpath [META-INF/resources/webjars/]]] and 3 interceptors
19:30:49.074 [http-nio-8080-exec-3] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Resource not found
19:30:49.074 [http-nio-8080-exec-3] TRACE o.s.web.servlet.DispatcherServlet - No view rendering, null ModelAndView returned.
19:30:49.074 [http-nio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Completed 404 NOT_FOUND, headers={masked}
Should see the swagger-ui page load showing book service resources.
Additional context
One of our APIs requires the use of large binary resource files. Springdoc is working aok for all the others. It is only failing where these large files are involved. I am able to replicate the issue in your own demo environment as detailed above.
The text was updated successfully, but these errors were encountered:
Describe the bug
(Note: I opened this issue with the springdoc team. They said this is actually a bug in webjars-locator - see discussion here: springdoc/springdoc-openapi#1249)
The logs show:
To Reproduce
head -c 400000000 /dev/urandom > BigTestFile1.bin
head -c 400000000 /dev/urandom > BigTestFile2.bin
head -c 400000000 /dev/urandom > BigTestFile3.bin
head -c 400000000 /dev/urandom > BigTestFile4.bin
head -c 400000000 /dev/urandom > BigTestFile5.bin
head -c 400000000 /dev/urandom > BigTestFile6.bin
head -c 400000000 /dev/urandom > BigTestFile7.bin
LargeFiles
in springdoc-openapi-book-service src/main/java/resources and place all 7 TestFiles in that folder.mvn clean package
java -jar ./target/springdoc-openapi-book-service-3.1.6-SNAPSHOT.jar
Expected behavior
Additional context
One of our APIs requires the use of large binary resource files. Springdoc is working aok for all the others. It is only failing where these large files are involved. I am able to replicate the issue in your own demo environment as detailed above.
The text was updated successfully, but these errors were encountered: