英文:
Error NaN: undefined Reason: undefined: Getting error after 1 minute
问题
我已经开发了一个Spring Boot应用程序,使用React作为前端。我正在将一个PDF文件流返回到浏览器。然而,当请求发送到控制器时,如果处理时间超过1分钟,屏幕上会显示错误 Error NaN: undefined Reason: undefined
我已经尝试在前端和后端增加了超时时间,但没有成功。我不确定这是否与超时有关。有人可以帮忙吗?以下是堆栈跟踪。
2023-03-06 12:22:33.678 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : GET "/print/error?error=undefined&message=undefined&reason=undefined", parameters={masked}
2023-03-06 12:22:33.680 DEBUG 13380 --- [-nio-443-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : 映射到 com.jcrew.labelprintbackend.controllers.FrontendController#print()
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.s.v.ContentNegotiatingViewResolver : 选择"text/html" [text/html, application/xhtml+xml, image/avif, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.7, */*;q=0.8]
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.servlet.view.InternalResourceView : 视图名称 'forward:', 模型 {}
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.servlet.view.InternalResourceView : 转发到 [/index.html]
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : "FORWARD" 请求转发到 GET "/index.html?error=undefined&message=undefined&reason=undefined", 参数={masked}
2023-03-06 12:22:33.684 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping : 映射到 ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.687 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : 退出"FORWARD"请求转发, 状态 200
2023-03-06 12:22:33.687 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : 完成 200 OK
2023-03-06 12:22:33.723 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : GET "/static/css/2.eefd091c.chunk.css", 参数={}
2023-03-06 12:22:33.726 DEBUG 13380 --- [-nio-443-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : 映射到 ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.766 DEBUG 13380 --- [-nio-443-exec-4] o.s.web.servlet.DispatcherServlet : GET "/static/js/2.7df57dd0.chunk.js", 参数={}
2023-03-06 12:22:33.767 DEBUG 13380 --- [-nio-443-exec-4] o.s.w.s.handler.SimpleUrlHandlerMapping : 映射到 ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.768 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : 完成 200 OK
2023-03-06 12:22:33.774 DEBUG 13380 --- [nio-443-exec-10] o.s.web.servlet.DispatcherServlet : GET "/static/js/main.2f79f0d9.chunk.js", 参数={}
2023-03-06 12:22:33.776 DEBUG 13380 --- [nio-443-exec-10] o.s.w.s.handler.SimpleUrlHandlerMapping : 映射到 ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.777 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : GET "/static/css/main.bc6778fd.chunk.css", 参数={}
2023-03-06 12:22:33.778 DEBUG 13380 --- [-nio-443-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : 映射到 ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.805 DEBUG 13380 --- [nio-443-exec-10] o.s.web.servlet.DispatcherServlet : 完成 200 OK
2023-03-06 12:22:33.832 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : 完成 200 OK
2023-03-06 12:22:33.859 DEBUG 13380 --- [-nio-443-exec-4] o.s.web.servlet.DispatcherServlet : 完成 200 OK
2023-03-06 12:22:33.927 DEBUG 13380 --- [-nio-443-exec-9] o.s.web.servlet.DispatcherServlet : GET "/favicon.ico", 参数={}
英文:
I have developed a Spring boot application, with React as Frontend. I'm Steaming a PDF back to the browser. However, when a Request goes to the Controller, and when the processing takes longer than 1 minute, I get an error on the Screen Error NaN: undefined Reason: undefined
I have tried increasing the timeout in both front as well as backend, but no luck. I'm not sure if this is related to timeout or not. Can someone please help. Below is the stack trace.
2023-03-06 12:22:33.678 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : GET "/print/error?error=undefined&message=undefined&reason=undefined", parameters={masked}
2023-03-06 12:22:33.680 DEBUG 13380 --- [-nio-443-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to com.jcrew.labelprintbackend.controllers.FrontendController#print()
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.s.v.ContentNegotiatingViewResolver : Selected 'text/html' given [text/html, application/xhtml+xml, image/avif, image/webp, image/apng, application/xml;q=0.9, application/signed-exchange;v=b3;q=0.7, */*;q=0.8]
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.servlet.view.InternalResourceView : View name 'forward:', model {}
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.servlet.view.InternalResourceView : Forwarding to [/index.html]
2023-03-06 12:22:33.682 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : "FORWARD" dispatch for GET "/index.html?error=undefined&message=undefined&reason=undefined", parameters={masked}
2023-03-06 12:22:33.684 DEBUG 13380 --- [-nio-443-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.687 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : Exiting from "FORWARD" dispatch, status 200
2023-03-06 12:22:33.687 DEBUG 13380 --- [-nio-443-exec-2] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2023-03-06 12:22:33.723 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : GET "/static/css/2.eefd091c.chunk.css", parameters={}
2023-03-06 12:22:33.726 DEBUG 13380 --- [-nio-443-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.766 DEBUG 13380 --- [-nio-443-exec-4] o.s.web.servlet.DispatcherServlet : GET "/static/js/2.7df57dd0.chunk.js", parameters={}
2023-03-06 12:22:33.767 DEBUG 13380 --- [-nio-443-exec-4] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.768 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2023-03-06 12:22:33.774 DEBUG 13380 --- [nio-443-exec-10] o.s.web.servlet.DispatcherServlet : GET "/static/js/main.2f79f0d9.chunk.js", parameters={}
2023-03-06 12:22:33.776 DEBUG 13380 --- [nio-443-exec-10] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.777 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : GET "/static/css/main.bc6778fd.chunk.css", parameters={}
2023-03-06 12:22:33.778 DEBUG 13380 --- [-nio-443-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped to ResourceHttpRequestHandler [Classpath [META-INF/resources/], Classpath [resources/], Classpath [static/], Classpath [public/], ServletContext [/]]
2023-03-06 12:22:33.805 DEBUG 13380 --- [nio-443-exec-10] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2023-03-06 12:22:33.832 DEBUG 13380 --- [-nio-443-exec-1] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2023-03-06 12:22:33.859 DEBUG 13380 --- [-nio-443-exec-4] o.s.web.servlet.DispatcherServlet : Completed 200 OK
2023-03-06 12:22:33.927 DEBUG 13380 --- [-nio-443-exec-9] o.s.web.servlet.DispatcherServlet : GET "/favicon.ico", parameters={}
答案1
得分: 0
SOLVED : 问题出在负载均衡器的超时值上。它被设置为1分钟。一旦增加了这个值,超时问题得以解决。
英文:
SOLVED : The problem was with the Load Balancer's time out value. It was set to 1 minute. Once this value was increased, the timeout problem got solved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论