获取zuul转发错误.使用尤里卡连接所有服务


Zuul->application.properties 
spring.application.name=zuul-api-gateway
server.port=6060
eureka.client.service-url.defaultZone = http://localhost:8761/eureka
eureka.instance.lease-expiration-duration-in-seconds=2
eureka.instance.lease-renewal-interval-in-seconds=2
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/springsecurity
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
zuul.host.connect-timeout-millis=999999
zuul.host.socket-timeout-millis=999999
zuul.routes.product-app.path=/product-details/**
zuul.routes.product-app.service-id=product-details
zuul.routes.product-ratings.path=/product-info/**
zuul.routes.product-ratings.service-id=product-info


zuul.routes.user-info.path=
zuul.routes.user-info.service-id=
ribbon.eureka.enabled=true

在此处附加堆栈跟踪:

com.netflix.zuul.exception.ZuulException:网址:org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.findZuulException(SendErrorFilter.java:118)~[spring-cloud-netflix-zuul-2.2.3.RELEASE.jar:2.2.3.RRELEASE]网址:org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.run(SendErrorFilter.java:78)~[spring-cloud-netflix-zuul-2.2.3.RELEASE.jar:2.2.3 RELEASE]网址:com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:117)[zuul-core-1.3.1.jar:1.3.1]网址:com.netflix。zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:193)[zuul-core-1.3.1.jar:1.3.1]网址:com.netflix。zuul.FilterProcessor.runFilters(FilterProcessor.java:157)[zuul-core-1.3.1.jar:1.3.1]网址:com.netflix。zuul.FilterProcessor.error(FilterProcessor.java:105)[zuul-core-1.3.1。jar:1.3.1]网址:com.netflix。zuul.ZuulRunner.error(ZuulRunner.java:112)[zuul-core-1.3.1。jar:1.3.1]网址:com.netflix.zuul.http.ZuulServlet.error(ZuulServlet.java:145)[zuul-core-1.3.1.jar:1.3.1]网址:com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:83)[zuul-core-1.3.1.jar:1.3.1]网址:org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrapplingController.java:166)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELENSE]网址:org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequest(ZuulControlr.java:45)[spring-cloud-netflix-zuul-2.2.3.RELEASE.jar:2.2.3 RELEASE]网址:org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:52)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELENSE]位于org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]位于org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELEASE]位于org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELENSE]网址:org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELENSE]位于javax.servlet.httpHttpServlet.service(HttpServlet.java:634)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)[spring-webmvc-5.2.7.RELEASE.jar:5.2.7.RELENSE]位于javax.servlet.httpHttpServlet.service(HttpServlet.java:741)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)[tomcat-embed-websocket-90.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.access.eccept.FilterSecurityInterceptor.ininvoke(FilterSecurityIntercepter.java:126)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.access.eccept.FilterSecurityInterceptor.doFilter(FilterSecurityIntercepter.java:90)[spring-security-web-5.3.3.RELEASE.jar:5.3.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]位于org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.authentication.AnymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAware RequestFilter.java:158)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter.doFilterInternal(DefaultLogoutPageGeneratingFilter.java:52)[spring-security-web-5.3.3.RELEASE.jar:5.3.3.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPgeGeneratingFilter.java:216)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessor.java:200)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.authentication.loogut.LogoutFilter.doFilter(LogoutFilter.java:116)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]位于org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegration Filter.java:56)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334)[spring-security-web-5.3.3.RELEASE.jar:5.3.RELEASE]网址:org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215)[spring-security-web-5.3.3.RELEASE.jar:5.3.3.RELEASE]网址:org.springframework.security.web.FilterChainPoxy.doFilter(FilterChainProxy.java:178)[spring-security-web-5.3.3.RELEASE.jar:5.3.3.RELEASE]网址:org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilter Proxy.java:358)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilter Proxy.java:271)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)[spring-boot-actuator-2.3.1.REASE.jar:2.3.1.REASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncoding filter.java:201)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest filter.java:119)[spring-web-5..2.7.RELEASE.jar:5.2.7.RELEASE]网址:org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.StandardWrapperValv.invoke(StandardWrapperValve.java:202)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.StandardContextValv.invoke(StandardContextValv.java:96)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.authenticator.AuthenticatorBase.ioke(AuthenticatorBase.java:541)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.StandardHostValv.invoke(StandardHostValve.java:139)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.vals.ErrorReportValve.ioke(ErrorReportValve.java:92)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.core.StandardEngineValv.invoke(StandardEngineValv.java:74)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.catalina.connecter.CoyoteAdapter.service(Coyotedapter.java:343)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.coyote.AbstractProcessorLight.produce(AbstractProcessorLight.java:65)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)[tomcat-embed-core-9.0.36.jar:9.0.36]网址:org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcat-embed-core-9.0.36.jar:9.0.36]位于java.util.concurrent.ThreadPoolExecutor.runWorker(未知源)[na:1.8.0_131]位于java.util.concurrent.ThreadPoolExecutor$Worker.run(未知源)[na:1.8.0_131]网址:org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-9.0.36.jar:9.0.36]在java.lang.Thread.run(未知源)[na:1.8.0_131]

您的应用程序有以下注释吗?

@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication

最新更新