Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinity loop when starting spring boot server #2907

Closed
Toerktumlare opened this issue Feb 15, 2019 · 23 comments
Closed

Infinity loop when starting spring boot server #2907

Toerktumlare opened this issue Feb 15, 2019 · 23 comments
Labels
Milestone

Comments

@Toerktumlare
Copy link

Toerktumlare commented Feb 15, 2019

Springfox version 2.9.2
Spring boot 2.1.2.RELEASE

im getting an infinite loop when starting up.

@Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .useDefaultResponseMessages(false) .select() .apis(RequestHandlerSelectors.basePackage("my.package.yay")) .paths(PathSelectors.any()) .build() .apiInfo(apiInfo());

2019-02-15 17:52:20.702 DEBUG 58784 --- [nio-8080-exec-5] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/bank-transfer-calculation-service/error", parameters={} 2019-02-15 17:52:20.703 DEBUG 58784 --- [nio-8080-exec-5] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-02-15 17:52:20.703 DEBUG 58784 --- [nio-8080-exec-5] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json] 2019-02-15 17:52:20.703 DEBUG 58784 --- [nio-8080-exec-5] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Fri Feb 15 17:52:20 CET 2019, status=404, error=Not Found, message=No message available, path=/bank-transfer-calculation-service/null/swagger-resources}] 2019-02-15 17:52:20.704 DEBUG 58784 --- [nio-8080-exec-5] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404 2019-02-15 17:52:20.710 DEBUG 58784 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : GET "/bank-transfer-calculation-service/null/swagger-resources/configuration/ui", parameters={} 2019-02-15 17:52:20.711 DEBUG 58784 --- [nio-8080-exec-6] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"] 2019-02-15 17:52:20.711 DEBUG 58784 --- [nio-8080-exec-6] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found 2019-02-15 17:52:20.711 DEBUG 58784 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND 2019-02-15 17:52:20.712 DEBUG 58784 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/bank-transfer-calculation-service/error", parameters={} 2019-02-15 17:52:20.712 DEBUG 58784 --- [nio-8080-exec-6] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-02-15 17:52:20.713 DEBUG 58784 --- [nio-8080-exec-6] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json] 2019-02-15 17:52:20.713 DEBUG 58784 --- [nio-8080-exec-6] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Fri Feb 15 17:52:20 CET 2019, status=404, error=Not Found, message=No message available, path=/bank-transfer-calculation-service/null/swagger-resources/configuration/ui}] 2019-02-15 17:52:20.714 DEBUG 58784 --- [nio-8080-exec-6] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404 2019-02-15 17:52:20.718 DEBUG 58784 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : GET "/bank-transfer-calculation-service/null/swagger-resources/configuration/security", parameters={} 2019-02-15 17:52:20.720 DEBUG 58784 --- [nio-8080-exec-7] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"] 2019-02-15 17:52:20.721 DEBUG 58784 --- [nio-8080-exec-7] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found 2019-02-15 17:52:20.721 DEBUG 58784 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND 2019-02-15 17:52:20.722 DEBUG 58784 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/bank-transfer-calculation-service/error", parameters={} 2019-02-15 17:52:20.724 DEBUG 58784 --- [nio-8080-exec-7] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-02-15 17:52:20.726 DEBUG 58784 --- [nio-8080-exec-7] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json] 2019-02-15 17:52:20.726 DEBUG 58784 --- [nio-8080-exec-7] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Fri Feb 15 17:52:20 CET 2019, status=404, error=Not Found, message=No message available, path=/bank-transfer-calculation-service/null/swagger-resources/configuration/security}] 2019-02-15 17:52:20.727 DEBUG 58784 --- [nio-8080-exec-7] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404 2019-02-15 17:52:20.731 DEBUG 58784 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : GET "/bank-transfer-calculation-service/null/swagger-resources", parameters={} 2019-02-15 17:52:20.732 DEBUG 58784 --- [nio-8080-exec-8] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"] 2019-02-15 17:52:20.733 DEBUG 58784 --- [nio-8080-exec-8] o.s.w.s.r.ResourceHttpRequestHandler : Resource not found 2019-02-15 17:52:20.734 DEBUG 58784 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Completed 404 NOT_FOUND 2019-02-15 17:52:20.734 DEBUG 58784 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/bank-transfer-calculation-service/error", parameters={} 2019-02-15 17:52:20.735 DEBUG 58784 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2019-02-15 17:52:20.735 DEBUG 58784 --- [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json] 2019-02-15 17:52:20.735 DEBUG 58784 --- [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Fri Feb 15 17:52:20 CET 2019, status=404, error=Not Found, message=No message available, path=/bank-transfer-calculation-service/null/swagger-resources}] 2019-02-15 17:52:20.736 DEBUG 58784 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 404 2019-02-15 17:52:20.742 DEBUG 58784 --- [nio-8080-exec-9] o.s.web.servlet.DispatcherServlet : GET "/bank-transfer-calculation-service/null/swagger-resources/configuration/ui", parameters={} 2019-02-15 17:52:20.743 DEBUG 58784 --- [nio-8080-exec-9] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler ["classpath:/ME

Why is it looking for path: "/bank-transfer-calculation-service/null/swagger-resources/configuration/ui"?

Whats the null value?

@Toerktumlare
Copy link
Author

Toerktumlare commented Feb 16, 2019

i don't really understand what is happening under the covers. I have tried debugging but as it seems is that if you don't explicitly set

.pathMapping("/")

To forward slash, the front end gui will DDOS your application under the covers, and you will not see this unless you run your spring boot in debug mode.

when front end is building it's path it has some value defaulted to null, and if it doesn't get something, it then builds it's path containing the null value.

I don't know if this is a bug, or there should be added a default value instead of the null as default.

@lombocska
Copy link

lombocska commented May 24, 2019

@Tandolf Hello,
I saw your issue here, and maybe can I ask you about Did you manage to solve this issue?

Was it something like this?
#3001

@Toerktumlare
Copy link
Author

hi @lombocska i wrote my solution. As you can see, i solved it by explicitly setting the pathMapping value to "/" in my docket. If i omitted this setting, the springfox front end gui would as i said loop over some sort of request to the backend trying to fetch something on ${myApplicationName}/null/configuration/ui

I have no idea whats happening under the hood. My guess is that the springfox gui does a call at startup back to the frontend to fetch its configuration settings. If you don't explicitly set the pathMapping it will default build some sort of URL with the value null in it.

@Toerktumlare
Copy link
Author

Toerktumlare commented May 24, 2019

this is the solution

@EnableSwagger2
public class SwaggerConfiguration {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .pathMapping("/") <----- This line of code
                .build();
    }
}

@lombocska
Copy link

:) @Tandolf

Now, the the pathMapping works, thank you!!

[2019-05-24 14:05:41] TRACE [nio-8080-exec-1] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-1] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-1] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:41] TRACE [nio-8080-exec-2] o.s.w.s.DispatcherServlet GET "/webjars/springfox-swagger-ui/springfox.css?v=2.9.2", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:41] TRACE [nio-8080-exec-3] o.s.w.s.DispatcherServlet GET "/webjars/springfox-swagger-ui/swagger-ui.css?v=2.9.2", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:41] TRACE [nio-8080-exec-2] o.s.w.s.h.SimpleUrlHandlerMapping Matching patterns [/webjars/**, /**]
[2019-05-24 14:05:41] TRACE [nio-8080-exec-3] o.s.w.s.h.SimpleUrlHandlerMapping Matching patterns [/webjars/**, /**]
[2019-05-24 14:05:41] TRACE [nio-8080-exec-3] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-2] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-2] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-2] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:41] TRACE [nio-8080-exec-3] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-3] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:41] TRACE [nio-8080-exec-4] o.s.w.s.DispatcherServlet GET "/webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=2.9.2", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:41] TRACE [nio-8080-exec-4] o.s.w.s.h.SimpleUrlHandlerMapping Matching patterns [/webjars/**, /**]
[2019-05-24 14:05:41] TRACE [nio-8080-exec-4] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-5] o.s.w.s.DispatcherServlet GET "/webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=2.9.2", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:41] TRACE [nio-8080-exec-5] o.s.w.s.h.SimpleUrlHandlerMapping Matching patterns [/webjars/**, /**]
[2019-05-24 14:05:41] TRACE [nio-8080-exec-5] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-6] o.s.w.s.DispatcherServlet GET "/webjars/springfox-swagger-ui/springfox.js?v=2.9.2", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:41] TRACE [nio-8080-exec-6] o.s.w.s.h.SimpleUrlHandlerMapping Matching patterns [/webjars/**, /**]
[2019-05-24 14:05:41] TRACE [nio-8080-exec-6] o.s.w.s.h.SimpleUrlHandlerMapping Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 5 interceptors
[2019-05-24 14:05:41] TRACE [nio-8080-exec-5] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-5] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:41] TRACE [nio-8080-exec-6] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-6] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:41] TRACE [nio-8080-exec-4] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:41] DEBUG [nio-8080-exec-4] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:42] TRACE [nio-8080-exec-7] o.s.w.s.DispatcherServlet GET "/swagger-resources/configuration/ui", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:42] TRACE [nio-8080-exec-7] o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped to public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
[2019-05-24 14:05:42] TRACE [nio-8080-exec-7] o.s.w.s.m.m.a.ServletInvocableHandlerMethod Arguments: []
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-7] o.s.w.s.m.m.a.HttpEntityMethodProcessor Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-7] o.s.w.s.m.m.a.HttpEntityMethodProcessor Writing [BaseView(data=springfox.documentation.swagger.web.UiConfiguration@36ad6755)]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-7] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-7] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:42] TRACE [nio-8080-exec-8] o.s.w.s.DispatcherServlet GET "/swagger-resources/configuration/security", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:42] TRACE [nio-8080-exec-8] o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped to public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
[2019-05-24 14:05:42] TRACE [nio-8080-exec-8] o.s.w.s.m.m.a.ServletInvocableHandlerMethod Arguments: []
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor Writing [BaseView(data=springfox.documentation.swagger.web.SecurityConfiguration@10d8dac5)]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-8] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-8] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}
[2019-05-24 14:05:42] TRACE [nio-8080-exec-9] o.s.w.s.DispatcherServlet GET "/swagger-resources", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
[2019-05-24 14:05:42] TRACE [nio-8080-exec-9] o.s.w.s.m.m.a.RequestMappingHandlerMapping Mapped to public org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
[2019-05-24 14:05:42] TRACE [nio-8080-exec-9] o.s.w.s.m.m.a.ServletInvocableHandlerMethod Arguments: []
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-9] o.s.w.s.m.m.a.HttpEntityMethodProcessor Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-9] o.s.w.s.m.m.a.HttpEntityMethodProcessor Writing [BaseView(data=[springfox.documentation.swagger.web.SwaggerResource@3ff587a3])]
[2019-05-24 14:05:42] TRACE [nio-8080-exec-9] o.s.w.s.DispatcherServlet No view rendering, null ModelAndView returned.
[2019-05-24 14:05:42] DEBUG [nio-8080-exec-9] o.s.w.s.DispatcherServlet Completed 200 OK, headers={masked}```

But overall, my ui does not work at all for the time being....

Nevermind, thanks for helping me! :) 

@stale
Copy link

stale bot commented Jun 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 24, 2020
@Toerktumlare
Copy link
Author

this is still an issue and should not be closed.

@stale stale bot removed the wontfix label Jun 24, 2020
@colameo
Copy link

colameo commented Jul 7, 2020

it happens also with:
Springfox version 2.10.5
Spring Boot 2.3.1.RELEASE

@dilipkrish
Copy link
Member

@colameo this should be fixed in the 3.0.0-SNAPSHOT that is releasing shortly

@dilipkrish dilipkrish added this to the 3.0 milestone Jul 8, 2020
@dilipkrish
Copy link
Member

This should now be fixed

@rabac
Copy link

rabac commented Oct 22, 2020

I don't think this is fixed.
I still see this error in version 3.0.0 - and I don't see it when running the application locally but only when it runs on Openshift.
Any idea what's going on?

@satishpatro44
Copy link

I am getting this in 2.9.2
This issue is apparently more weird then I thought.
We have multi module app, where common packages (build.gradle), config of swagger is there. This issue is coming for only one module, but not coming for other.
And, that to it comes only when chromium related browsers (chrome, edge new) is opened.

@peeyushsurolia
Copy link

I believe this issue should not be closed , I am still facing same issue with following code changes

compile group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

@Bean
  public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
        .select()
        .apis(RequestHandlerSelectors.any())
        .paths(PathSelectors.any())
        .build()
        .pathMapping("/");
  }

Getting Error in infinity loop after starting server : null/swagger-resources/configuration/ui

@nicovanbelle
Copy link

nicovanbelle commented Feb 18, 2021

I'm also still getting this exception.. very weird. Added pathMapping but it did not help.

Update for no obvious reason, rebooting my computer did the trick. Invalidate cache of IntelliJ did not solve it.

@kirillt-home
Copy link

In my case it was old swagger (from previous app launch) openned in browser who did this calls

@mvershinin-chwy
Copy link

Still an issue, experienced this in 3.0.0

@igarciadev
Copy link

In my case it was old swagger (from previous app launch) openned in browser who did this calls

In my case, the issue was the same

@colwynB2K
Copy link

colwynB2K commented May 26, 2021

To me it seems more like possible timing issue in the frontend code to me?

https://github.com/springfox/springfox/blob/2.9.2/springfox-swagger-ui/src/web/js/springfox.js

At window load it seems to try to get the base url and I think the result is null at point

const getBaseURL = () => { const urlMatches = /(.)/swagger-ui.html./.exec(window.location.href); return urlMatches[1]; };

This result is then used in

/* Entry Point */
(async () => {
await buildSystemAsync(getBaseURL());
await csrfSupport(getBaseURL()); })();

And inside buildSystemAsync there is a exception catch clause which basically just retries the same thing over and over, although it seems that the intention is to prompt the user for input? Maybe it is a race-condition where other code triggers a page reload which again triggers the code above.

} catch (e) { const retryURL = await prompt( "Unable to infer base url. This is common when using dynamic servlet registration or when" + " the API is behind an API Gateway. The base url is the root of where" + " all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs" + " then the base url is http://example.org/api/. Please enter the location manually: ", window.location.href);
return buildSystemAsync(retryURL); }

Not being a frontend developer, I looked up wat the prompt function does and I think that if you combine it with await that it may time out and then use the default value mentioned with the prompt function, in this case window.location.href and that is when the loop starts. But this is purely speculation and needs a frontend dev to look at it.

@electrobabe
Copy link

In my case with Swagger 3.0.0 - especially io.springfox:springfox-boot-starter - specifying the spring-boot URL context-path solved this loop:

  • in application.properties: server.servlet.context-path=/
  • Or if you have an application.yml file:
server:
  servlet:
    context-path: /

Warning: It will change the base path of all web services, not only Swagger

@ThiagoAnd
Copy link

Had the same looping issue using springfox-boot-starter version 3.0.0. with windows, and intellij

In my case it was old swagger (from previous app launch) openned in browser who did this calls

apparently for me that was the problem. I had opened the local application at the url of the old swagger:
http://localhost:8080/swagger-ui.html#/

And I saw that it was still there, I closed the tab, ran the application again and opened it in the new url of openapi 3.0:
http://localhost:8080/swagger-ui/index.html#/

I believe that was it, because before I tried to change the application.yml and docket settings according to what the colleagues above said and it didn't work.

@colameo
Copy link

colameo commented May 5, 2022

...don't waste your time and switch to spring-doc

@fireinrain
Copy link

I have the same issue. why PropertySourcedRequestMappingHandlerMapping is loging infinity log for looking up handler for path: /error

@fireinrain
Copy link

You cant close this issue, it's not be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests