The Spring Cloud Gateway works correctly in older applications.
Older app's pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>corp.com</groupId>
<artifactId>im</artifactId>
<version>2.0.0-rc11-SNAPSHOT</version>
<name>im</name>
<description>IM app</description>
<properties>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-batch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<exclusions>
<exclusion>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
But when I try with a new app:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>corp.com</groupId>
<artifactId>ktr</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ktr</name>
<packaging>pom</packaging>
<description>KTR Root</description>
<modules>
<module>ktr-backend</module>
<module>ktr-frontend</module>
</modules>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>corp.com</groupId>
<artifactId>ktr</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>ktr-backend</artifactId>
<name>ktr-backend</name>
<description>KTR</description>
<properties>
<java.version>11</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<log4j2.version>2.16.0</log4j2.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
<exclusions>
<exclusion>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
I have the following error ->
GET https://lts.corp.app.com:8443/ktr-api/backend/list-data log:
|TRACE|http-nio-2|erver.adapter.HttpWebHandlerAdapter|[162c8bde] HTTP GET "/ktr-api/backend/list-data", headers={masked}
|TRACE|http-nio-2|ay.filter.WeightCalculatorWebFilter|Weights attr: {}
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/cdp/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/dr/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/dw/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/pi/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/tat/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/im/**]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/ktr-api/backend/list-data"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "/ktr-api/**" matches against value "/ktr-api/backend/list-data"
|DEBUG|http-nio-2|andler.RoutePredicateHandlerMapping|Route matched: ktr-api
|DEBUG|http-nio-2|andler.RoutePredicateHandlerMapping|Mapping [Exchange: GET https://lts.corp.app.com:8443/ktr-api/backend/list-data] to Route{id='api', uri=http://localhost:8445, order=0, predicate=Paths: [/ktr-api/**], match trailing slash: true, gatewayFilters=[[[StripPrefix parts = 1], order = 1]], metadata={}}
|DEBUG|http-nio-2|andler.RoutePredicateHandlerMapping|[162c8bde] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler#783cd7f0
|DEBUG|http-nio-2|gateway.handler.FilteringWebHandler|Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter#56de6d6b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter#bcb09a6}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter#5e840abf}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter#31e32ea2}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter#5b5c0057}, order = 0], [[StripPrefix parts = 1], order = 1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter#5972d253}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration$NoLoadBalancerClientFilter#749f539e}, order = 10100], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter#1473b8c0}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter#1280851e}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter#4fcc0416}, order = 2147483647]]
|TRACE|http-nio-2|eway.filter.RouteToRequestUrlFilter|RouteToRequestUrlFilter start
|TRACE|http-nio-2|d.gateway.filter.NettyRoutingFilter|outbound route: 73c9c229, inbound: [162c8bde]
|TRACE|http-nio-2|ive.function.server.RouterFunctions|[162c8bde] Matched org.springframework.boot.autoconfigure.web.reactive.error.DefaultErrorWebExceptionHandler$$Lambda$1024/0x0000000840774840#795b4c1a
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'server.ports'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'configurationProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'gateway-properties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemEnvironment'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'random'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudClientHostInfo'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [file:./config/cag-test.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [classpath:/application.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudDefaultProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'Management Server'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Could not find key 'spring.template.provider.cache' in any property source
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'server.ports'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'configurationProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'gateway-properties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemEnvironment'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'random'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudClientHostInfo'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [file:./config/cag-test.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [classpath:/application.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudDefaultProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'Management Server'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Could not find key 'spring.template.provider.cache' in any property source
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'server.ports'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'configurationProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'gateway-properties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'systemEnvironment'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'random'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudClientHostInfo'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [file:./config/cag-test.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'applicationConfig: [classpath:/application.yaml]'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'springCloudDefaultProperties'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Searching for key 'spring.template.provider.cache' in PropertySource 'Management Server'
|TRACE|http-nio-2|env.PropertySourcesPropertyResolver|Could not find key 'spring.template.provider.cache' in any property source
|DEBUG|http-nio-2|org.springframework.web.HttpLogging|[162c8bde] Resolved [PrematureCloseException: Connection prematurely closed BEFORE response] for HTTP GET /ktr-api/backend/list-data
|ERROR|http-nio-2|or.AbstractErrorWebExceptionHandler|[162c8bde] 500 Server Error for HTTP GET "/ktr-api/backend/list-data"
reactor.netty.http.client.PrematureCloseException: Connection prematurely closed BEFORE response
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.authorization.AuthorizationWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.authorization.ExceptionTranslationWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.authentication.logout.LogoutWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.savedrequest.ServerRequestCacheWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.context.SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.context.ReactorContextWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.header.HttpHeaderWriterWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.config.web.server.ServerHttpSecurity$ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
|_ checkpoint ⇢ org.springframework.boot.actuate.metrics.web.reactive.server.MetricsWebFilter [DefaultWebFilterChain]
|_ checkpoint ⇢ HTTP GET "/ktr-api/backend/list-data" [ExceptionHandlingWebHandler]
Stack trace:
|TRACE|http-nio-2|work.core.codec.CharSequenceEncoder|[162c8bde] Writing "<html><body><h1>Whitelabel Error Page</h1><p>This application has no configured error view, so you are seeing this as a fallback.</p><div id='created'>Tue Aug 02 14:01:08 CEST 2022</div><div>[162c8bde] There was an unexpected error (type=Internal Server Error, status=500).</div><div>An internal server error occurred. Please see logs for details.</div></body></html>"
|TRACE|http-nio-2|gateway.filter.GatewayMetricsFilter|gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=500),tag(outcome=SERVER_ERROR),tag(routeId=api),tag(routeUri=http://localhost:8445),tag(status=INTERNAL_SERVER_ERROR)]
|TRACE|http-nio-2|erver.adapter.HttpWebHandlerAdapter|[162c8bde] Completed 500 INTERNAL_SERVER_ERROR, headers={masked}
|TRACE|http-nio-2|.reactive.ReactorHttpHandlerAdapter|[162c8bde] Handling completed
|TRACE|http-nio-2|erver.adapter.HttpWebHandlerAdapter|[162c8bde] HTTP GET "/favicon.ico", headers={masked}
|TRACE|http-nio-2|ay.filter.WeightCalculatorWebFilter|Weights attr: {}
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/cdp/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/dr/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/dw/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/pi/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/tat/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/im/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/ktr-api/**]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|ler.predicate.RoutePredicateFactory|Pattern "[/v3/api-docs]" does not match against value "/favicon.ico"
|TRACE|http-nio-2|andler.RoutePredicateHandlerMapping|No RouteDefinition found for [Exchange: GET https://lts.corp.app.com:8443/favicon.ico]
|DEBUG|http-nio-2|ive.handler.SimpleUrlHandlerMapping|[162c8bde] Mapped to ResourceWebHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"]
|DEBUG|http-nio-2|ramework.core.codec.ResourceEncoder|[162c8bde] Writing [class path resource [static/favicon.ico]]
|TRACE|http-nio-2|erver.adapter.HttpWebHandlerAdapter|[162c8bde] Completed 200 OK, headers={masked}
|TRACE|http-nio-2|.reactive.ReactorHttpHandlerAdapter|[162c8bde] Handling completed
And this is the log with an older app -> GET https://lts.corp.app.com:8443/im/activity/asd/1
|TRACE|http-nio-1|erver.adapter.HttpWebHandlerAdapter|[da7e5ce1] HTTP GET "/im/activity/asd/1", headers={masked}
|TRACE|http-nio-1|ay.filter.WeightCalculatorWebFilter|Weights attr: {}
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/cdp/**]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/dr/**]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/dw/**]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/pi/**]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/tat/**]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "[/v2/api-docs]" does not match against value "/im/activity/asd/1"
|TRACE|http-nio-1|ler.predicate.RoutePredicateFactory|Pattern "/im/**" matches against value "/im/activity/asd/1"
|DEBUG|http-nio-1|andler.RoutePredicateHandlerMapping|Route matched: im
|DEBUG|http-nio-1|andler.RoutePredicateHandlerMapping|Mapping [Exchange: GET https://lts.corp.app.com:8443/im/activity/asd/1] to Route{id='im', uri=http://localhost:8086, order=0, predicate=Paths: [/im/**], match trailing slash: true, gatewayFilters=[[[StripPrefix parts = 1], order = 1]], metadata={}}
|DEBUG|http-nio-1|andler.RoutePredicateHandlerMapping|[da7e5ce1] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler#783cd7f0
|DEBUG|http-nio-1|gateway.handler.FilteringWebHandler|Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter#56de6d6b}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter#bcb09a6}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter#5e840abf}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter#31e32ea2}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter#5b5c0057}, order = 0], [[StripPrefix parts = 1], order = 1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter#5972d253}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration$NoLoadBalancerClientFilter#749f539e}, order = 10100], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter#1473b8c0}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter#1280851e}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter#4fcc0416}, order = 2147483647]]
|TRACE|http-nio-1|eway.filter.RouteToRequestUrlFilter|RouteToRequestUrlFilter start
|TRACE|http-nio-1|d.gateway.filter.NettyRoutingFilter|outbound route: 0aeb1fcf, inbound: [da7e5ce1]
|TRACE|http-nio-1|way.filter.NettyWriteResponseFilter|NettyWriteResponseFilter start inbound: 0aeb1fcf, outbound: [da7e5ce1]
|TRACE|http-nio-1|gateway.filter.GatewayMetricsFilter|gateway.requests tags: [tag(httpMethod=GET),tag(httpStatusCode=200),tag(outcome=SUCCESSFUL),tag(routeId=im),tag(routeUri=http://localhost:8086),tag(status=OK)]
|TRACE|http-nio-1|erver.adapter.HttpWebHandlerAdapter|[da7e5ce1] Completed 200 OK, headers={masked}
|TRACE|http-nio-1|.reactive.ReactorHttpHandlerAdapter|[da7e5ce1] Handling completed
gateway's pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.corp</groupId>
<artifactId>api-gateway</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>api-gateway</name>
<description>API Gateway</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Gateway's application.yaml:
server:
port: 8443
spring:
application:
name: #project.name#
boot:
admin:
client:
api-path: /admin/instance
main:
banner-mode: "off"
web-application-type: reactive
cloud:
gateway:
routes:
- id: cdp
uri: http://localhost:8081
predicates:
- Path=/cdp/**
filters:
- StripPrefix=1
- id: cdp-swagger
uri: http://localhost:8081
predicates:
- Path=/v2/api-docs
- Query=group, cdp-tasks
- id: dr
uri: http://localhost:8082
predicates:
- Path=/dr/**
filters:
- StripPrefix=1
- id: dr-swagger
uri: http://localhost:8082
predicates:
- Path=/v2/api-docs
- Query=group, dr-tasks
- id: dw
uri: http://localhost:8083
predicates:
- Path=/dw/**
filters:
- StripPrefix=1
- id: dw-swagger
uri: http://localhost:8083
predicates:
- Path=/v2/api-docs
- Query=group, dw-tasks
- id: pi
uri: http://localhost:8084
predicates:
- Path=/pi/**
filters:
- StripPrefix=1
- id: pi-swagger
uri: http://localhost:8084
predicates:
- Path=/v2/api-docs
- Query=group, pi-tasks
- id: tat
uri: http://localhost:8085
predicates:
- Path=/tat/**
filters:
- StripPrefix=1
- id: tat-swagger
uri: http://localhost:8085
predicates:
- Path=/v2/api-docs
- Query=group, tat-tasks
- id: im
uri: http://localhost:8086
predicates:
- Path=/im/**
filters:
- StripPrefix=1
- id: im-swagger
uri: http://localhost:8086
predicates:
- Path=/v2/api-docs
- Query=group, im-tasks
- id: ktr-api
uri: http://localhost:8445
predicates:
- Path=/ktr-api/**
filters:
- StripPrefix=1
- id: ktr-swagger
uri: http://localhost:8445
predicates:
- Path=/v3/api-docs
- Query=group, ktr-tasks
NOTE: It throws the error instantly.
I found the problem.
I had to use https://localhost:8445 instead of http://localhost:8445
I was expecting a different error message in this case, so it didn't even occur to me that this was the problem.
What I can highly recommend to everyone in this case is that if you can ssh into the given server, try to start a get request from the console directly to the server that you would call via the gateway.
This is how I found out that the problem is not with the gateway at all.
Related
Hi I am trying out the latest Spring cloud stream framework for Kafka. However, for String and Double its working fine but when I try to send a Java POJO class, it throws the below exception.
I have tried various configuration for serialization and deserialization but nothing seems to be working.
I am able to produce the message from the Supplier, as json but the consumers are not able to process it due to the error.
Any suggestions for the issue would be appreciated.
Thanks
org.springframework.kafka.listener.ListenerExecutionFailedException: Listener failed; nested exception is org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.cloud.stream.function.FunctionConfiguration$FunctionToDestinationBinder$1#25625f0f]; nested exception is java.lang.ClassCastException: class [B cannot be cast to class com.msg.bt.Grade ([B is in module java.base of loader 'bootstrap'; com.msg.bt.Grade is in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader #475530b9), failedMessage=GenericMessage [payload=byte[72], headers={kafka_offset=804, scst_nativeHeadersPresent=true, kafka_consumer=org.apache.kafka.clients.consumer.KafkaConsumer#24ee2e4c, deliveryAttempt=3, kafka_timestampType=CREATE_TIME, kafka_receivedPartitionId=0, contentType=application/json, kafka_receivedTopic=random-topic-2, kafka_receivedTimestamp=1624778145945, kafka_groupId=mypublish-reader-group, target-protocol=kafka}]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.decorateException(KafkaMessageListenerContainer.java:2371) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeOnMessage(KafkaMessageListenerContainer.java:2339) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeOnMessage(KafkaMessageListenerContainer.java:2300) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:2214) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeWithRecords(KafkaMessageListenerContainer.java:2139) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:2021) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:1703) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeIfHaveRecords(KafkaMessageListenerContainer.java:1272) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:1264) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:1161) ~[spring-kafka-2.7.3.jar!/:2.7.3]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]
Caused by: org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.cloud.stream.function.FunctionConfiguration$FunctionToDestinationBinder$1#25625f0f]; nested exception is java.lang.ClassCastException: class [B cannot be cast to class com.msg.bt.Grade ([B is in module java.base of loader 'bootstrap'; com.msg.bt.Grade is in unnamed module of loader org.springframework.boot.loader.LaunchedURLClassLoader #475530b9)
at org.springframework.integration.support.utils.IntegrationUtils.wrapInHandlingExceptionIfNecessary(IntegrationUtils.java:192) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:65) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:133) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:106) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:72) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:317) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:272) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:187) ~[spring-messaging-5.3.8.jar!/:5.3.8]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:166) ~[spring-messaging-5.3.8.jar!/:5.3.8]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:47) ~[spring-messaging-5.3.8.jar!/:5.3.8]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109) ~[spring-messaging-5.3.8.jar!/:5.3.8]
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:208) ~[spring-integration-core-5.5.1.jar!/:5.5.1]
at org.springframework.integration.kafka.inbound.KafkaMessageDrivenChannelAdapter.sendMessageIfAny(KafkaMessageDrivenChannelAdapter.java:398) ~[spring-integration-kafka-5.5.1.jar!/:5.5.1]
Below is the POM.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.sample</groupId>
<artifactId>message</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>message</name>
<description>Spring messaging sample</description>
<properties>
<java.version>11</java.version>
<spring-cloud.version>2020.0.3</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka-streams</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Below is the application
#Bean
public Supplier<Grade> random() {
return () -> {
System.out.println("=========In Supplier --------------------");
return new Grade(UUID.randomUUID().toString(),Math.random()*100);
};
}
#Bean
public Function<Grade, String> publish() {
System.out.println("##############In Function user--------------------");
return user -> "User:: " + user.toString();
}
#Bean
public Consumer<String> log() {
System.out.println("++++++++++++In log --------------------");
return s -> {
System.out.println("Received>> " + s);
};
}
application.yml
spring:
application:
name: kafka-messaging
json:
value:
default:
type: com.msg.Grade
trusted:
packages: com.msg
cloud:
function:
definition: random;publish;log
stream:
bindings:
random-out-0:
destination: random-topic-2
publish-in-0:
destination: random-topic-2
group: mypublish-reader-group
publish-out-0:
destination: message-topic-2
log-in-0:
destination: message-topic-2
group: message-reader-group
kafka:
binder:
brokers: localhost:9092
Finally I found out the issue.
Feel extremely stupid because the issue was that there was no default no-arg constructor in the Model class. After adding the no-arg constructor, all works as expected.
I am new to kafka with spring cloud stream.the application is in two in one.
the first application is producing to kafka topic (com.ng.vela.even.card_verified) which is very accurate but the second one is give me the following in my console but messages are not being comsumed from the kafka topic.
This is what am getting in my console .
020-06-24 14:36:07.168 INFO 7784 --- [container-0-C-1] o.a.k.c.c.internals.AbstractCoordinator : [Consumer clientId=consumer-anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9-24, groupId=anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9] Successfully joined group with generation 1
2020-06-24 14:36:07.170 INFO 7784 --- [container-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator : [Consumer clientId=consumer-anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9-24, groupId=anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9] Adding newly assigned partitions: com.ng.vela.even.card_verified-0
2020-06-24 14:36:07.171 INFO 7784 --- [ restartedMain] .ConditionEvaluationDeltaLoggingListener : Condition evaluation unchanged
2020-06-24 14:36:07.171 INFO 7784 --- [container-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator : [Consumer clientId=consumer-anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9-24, groupId=anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9] Found no committed offset for partition com.ng.vela.even.card_verified-0
2020-06-24 14:36:07.173 INFO 7784 --- [container-0-C-1] o.a.k.c.c.internals.ConsumerCoordinator : [Consumer clientId=consumer-anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9-24, groupId=anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9] Found no committed offset for partition com.ng.vela.even.card_verified-0
2020-06-24 14:36:07.180 INFO 7784 --- [container-0-C-1] o.a.k.c.c.internals.SubscriptionState : [Consumer clientId=consumer-anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9-24, groupId=anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9] Resetting offset for partition com.ng.vela.even.card_verified-0 to offset 63.
2020-06-24 14:36:07.183 INFO 7784 --- [container-0-C-1] o.s.c.s.b.k.KafkaMessageChannelBinder$1 : anonymous.1bf08674-d2fd-447a-b7d6-ce0c9eb597e9: partitions assigned: [com.ng.vela.even.card_verified-0]
the java source code is this below cos I am trying to follow the documentation of spring cloud stream :
package com.mint.financial;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.context.annotation.Bean;
import org.springframework.messaging.handler.annotation.SendTo;
import com.mint.financial.entity.CardSchemeStream;
import com.mint.financial.kafka.consumer.CardSchemeKafkaConsumer;
#SpringBootApplication
#EnableBinding(Processor.class)
public class MintFinancialClientConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(MintFinancialClientConsumerApplication.class, args);
}
#StreamListener(Processor.INPUT)
#SendTo(Processor.OUTPUT)
public String handle(String value) {
System.out.println("Received: " + value);
return value ;
}
#Bean
public CardSchemeStream getCardSchemeStream() {
return new CardSchemeStream() ;
}
#Bean
public ApplicationRunner initializeConnection(){
return args -> {
System.out.println("handler testing for api working also with application runner");
};
}
}
The pom is
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.mint</groupId>
<artifactId>MintFinance</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>MintFinancialClientConsumer</name>
<description>Visa Validation project Consumer for mint financial technology</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
The application.properties file is
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.repositories.enabled=true
spring.data.mongodb.database=mint
spring.cloud.stream.kafka.binders.broker=9092
spring.cloud.stream.kafka.binder.zkNodes=2181
spring.cloud.stream.input.group.name=test-consumer-group
spring.cloud.stream.bindings.output.destination=com.ng.vela.even.card_verified
spring.cloud.stream.bindings.input.destination=com.ng.vela.even.card_verified
#spring.cloud.stream.bindings.input.destination=first-topic
#spring.cloud.stream.bindings.output.destination=first-topic
spring.cloud.stream.bindings.output.producer.partitionCount=1
spring.cloud.stream.bindings.output.content-type=text/plain
spring.cloud.stream.bindings.output.producer.headerMode=headers
As shown above, every other thing is working including the connection to mongodb
but i cant just consume messages that i have produced to kafka.I am trying to produce and consume from the same topic.
I have even considered using the default consumer group due to the error, but all to no avail.
Again,I changed the replication factor in server.properties file to 3 but yet nothing is working.
I have searched everywhere . please guys i need your help .
i'am using spring boot with oracle V11.2.0.4.0 database to develop a microservice,
But my pringBootApplication failed to run due to this following error:
2020-02-18 15:24:12.943 INFO 16476 --- [ main] com.zaxxer.hikari.HikariDataSource :
HikariPool-1 - Starting...
2020-02-18 15:24:13.041 INFO 16476 --- [ main] com.zaxxer.hikari.pool.PoolBase :
HikariPool-1 - Driver does not support get/set network timeout for connections.
(oracle.jdbc.driver.T4CConnection.getNetworkTimeout()I)
2020-02-18 15:24:13.045 INFO 16476 --- [ main] com.zaxxer.hikari.HikariDataSource :
HikariPool-1 - Start completed.
2020-02-18 15:24:13.058 INFO 16476 --- [ main] org.hibernate.dialect.Dialect :
HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
2020-02-18 15:24:13.205 **ERROR** 16476 --- [ main] o.h.e.j.e.internal.JdbcEnvironmentImpl :
Could not fetch the SequenceInformation from the database
2020-02-18 15:24:13.662 WARN 16476 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper :
SQL Error: 17026, SQLState: 99999
2020-02-18 15:24:13.662 ERROR 16476 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper :
Numeric Overflow
2020-02-18 15:24:13.668 WARN 16476 --- [ main] ConfigServletWebServerApplicationContext :
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'entityManagerFactory' defined in class path resource
[org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init
method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default]
Unable to build Hibernate SessionFactory; nested exception is
org.hibernate.exception.GenericJDBCException: Unable to build DatabaseInformation
2020-02-18 15:24:13.668 INFO 16476 --- [ main] com.zaxxer.hikari.HikariDataSource :
Error starting ApplicationContext. To display the conditions report re-run your application with
'debug' enabled.
2020-02-18 15:24:13.702 ERROR 16476 --- [ main] o.s.boot.SpringApplication :
Application run failed
java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4170) ~[ojdbc6-
11.2.0.4.0.jar:12.1.0.1.0]
Here is my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-
4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>ibbl.lu</groupId>
<artifactId>microservice_lims</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>microservice_lims</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- ojdbc6.jar example -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
here is my application.properties
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url= jdbc:oracle:thin:#Oracle-dev.xxx.xx.xx:1521:LBVT
spring.datasource.username=xxxx
spring.datasource.password=xxx!
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.jpa.show-sql=true
Someone have an idea about this issue ?
I already download the ojdbc6.jar and use maven command to install the driver
any clue will be helpful
The problem is due to MAX_VALUE to large in All_sequence,
That's why i had this error
java.sql.SQLException: Numeric Overflow
I fixed this issue as follows:
I created a Custom class which extends Oracle10gDialect and redefined MIN_VALUE, MAX_VALUE in ALL_SEQUENCES,
Here is my class
package ibbl.lu.microservice_lims.config;
import org.hibernate.dialect.Oracle10gDialect;
public class CustomOracleDialect extends Oracle10gDialect {
#Override
public String getQuerySequencesString() {
return "SELECT SEQUENCE_OWNER, SEQUENCE_NAME,
greatest(MIN_VALUE,-9223372036854775807) MIN_VALUE,\n" +
"Least(MAX_VALUE, 9223372036854775808) MAX_VALUE,
INCREMENT_BY,CYCLE_FLAG, ORDER_FLAG, CACHE_SIZE,\n" +
"Least(greatest(LAST_NUMBER, -9223372036854775807),
9223372036854775808) LAST_NUMBER from ALL_SEQUENCES";
}
}
In the application.properties file referred to a dialect implementation
spring.jpa.properties.hibernate.dialect=ibbl.lu.microservice_lims.config.CustomOracleDialect
Facing the issue since I have added Hateoas dependency to my Spring boot project and deploying on weblogic server 12c
Error starting ApplicationContext. To display the conditions report
re-run your application with 'debug' enabled. 2020-01-09 14:18:53,591
ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter
[[STANDBY] ExecuteThread: '3' for queue:
'weblogic.kernel.Default (self-tuning)']
APPLICATION FAILED TO START
Description:
Parameter 0 of method linkDiscoverers in org.springframework.hateoas.config.HateoasConfiguration required a
single bean, but 15 were found:
- modelBuilderPluginRegistry: defined in null
- modelPropertyBuilderPluginRegistry: defined in null
- typeNameProviderPluginRegistry: defined in null
- documentationPluginRegistry: defined in null
- apiListingBuilderPluginRegistry: defined in null
- operationBuilderPluginRegistry: defined in null
- parameterBuilderPluginRegistry: defined in null
- expandedParameterBuilderPluginRegistry: defined in null
- resourceGroupingStrategyRegistry: defined in null
- operationModelsProviderPluginRegistry: defined in null
- defaultsProviderPluginRegistry: defined in null
- pathDecoratorRegistry: defined in null
- relProviderPluginRegistry: defined by method 'relProviderPluginRegistry' in class path resource
[org/springframework/hateoas/config/HateoasConfiguration.class]
- linkDiscovererRegistry: defined in null
- entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry' in class path resource
[org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]
Action:
Consider marking one of the beans as #Primary, updating the consumer to accept multiple beans, or using #Qualifier to identify the
bean that should be consumed
<09-Jan-2020, 2:18:53,633 PM IST> ' available: expected single
matching bean but found 15:
modelBuilderPluginRegistry,modelPropertyBuilderPluginRegistry,typeNameProviderPluginRegistry,documentationPluginRegistry,apiListingBuilderPluginRegistry,operationBuilderPluginRegistry,parameterBuilderPluginRegistry,expandedParameterBuilderPluginRegistry,resourceGroupingStrategyRegistry,operationModelsProviderPluginRegistry,defaultsProviderPluginRegistry,pathDecoratorRegistry,relProviderPluginRegistry,linkDiscovererRegistry,entityLinksPluginRegistry
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No
qualifying bean of type
'org.springframework.plugin.core.PluginRegistry' available: expected single
matching bean but found 15:
modelBuilderPluginRegistry,modelPropertyBuilderPluginRegistry,typeNameProviderPluginRegistry,documentationPluginRegistry,apiListingBuilderPluginRegistry,operationBuilderPluginRegistry,parameterBuilderPluginRegistry,expandedParameterBuilderPluginRegistry,resourceGroupingStrategyRegistry,operationModelsProviderPluginRegistry,defaultsProviderPluginRegistry,pathDecoratorRegistry,relProviderPluginRegistry,linkDiscovererRegistry,entityLinksPluginRegistry
at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:220)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1265)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:874)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:778)
Truncated. see log file for complete stacktrace
>
<09-Jan-2020, 2:18:53,674 PM IST>
<09-Jan-2020, 2:18:53,775 PM IST>
<09-Jan-2020, 2:18:53,834 PM IST>
<09-Jan-2020, 2:18:53,981 PM IST>
<09-Jan-2020, 2:18:53,988 PM IST>
<09-Jan-2020, 2:18:53,992 PM IST>
<09-Jan-2020, 2:18:54,0 PM IST>
POM.xml file :
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.bt</groupId>
<artifactId>Some project</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>some Project</name>
<description>REST enabled adapter to communicate with tetProject database</description>
<repositories>
<repository>
<id>some Repo</id>
<name><xyz.some.name></name>
<url><xyz.some.url></url>
</repository>
</repositories>
<properties>
<java.version>1.8</java.version>
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>commonlibs.com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>commonlibs.com.bea.core</groupId>
<artifactId>com.bea.core.datasource6_1.7.0.0</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>commonlibs.com.bea.core.utils</groupId>
<artifactId>com.bea.core.utils.wrapper_1.4.0.0</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
<version>1.2.2.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>Some project</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
Spring is telling you the problem
org.springframework.hateoas.config.HateoasConfiguration required a single bean,
but 15 were found:
Which means that there are 15 methods that return a bean that fits HateoasConfiguration.
Who are those bastards?
Spring continues right after with the list:
- modelBuilderPluginRegistry: defined in null
- modelPropertyBuilderPluginRegistry: defined in null
- typeNameProviderPluginRegistry: defined in null
- documentationPluginRegistry: defined in null
- apiListingBuilderPluginRegistry: defined in null
- operationBuilderPluginRegistry: defined in null
- parameterBuilderPluginRegistry: defined in null
- expandedParameterBuilderPluginRegistry: defined in null
- resourceGroupingStrategyRegistry: defined in null
- operationModelsProviderPluginRegistry: defined in null
- defaultsProviderPluginRegistry: defined in null
- pathDecoratorRegistry: defined in null
- relProviderPluginRegistry: defined by method 'relProviderPluginRegistry'
in class path resource
[org/springframework/hateoas/config/HateoasConfiguration.class]
- linkDiscovererRegistry: defined in null
- entityLinksPluginRegistry: defined by method 'entityLinksPluginRegistry'
in class path resource
[org/springframework/hateoas/config/WebMvcEntityLinksConfiguration.class]
The list might be not so clear or familiar as it might be that some of these methods are defined by the framework.
So what can be done?
Spring is suggesting a solution:
Action:
Consider marking one of the beans as #Primary,
updating the consumer to accept multiple beans,
or using #Qualifier to identify the bean that should be consumed
Does it mean that I need to reconfigure my #Beans?
Not necessarily. First try to see if someone else faced the same problem.
You may find the solution there.
I am facing the same issue as posted in the question Spring Security + AAD: invalid_token_response
I did try 2.1.0, it didn't help.
I am currently using Spring-boot 2.1.2, spring-security-oauth2-client 5.1.3 and i am still getting the same error
I am sharing my pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>perdict</groupId>
<artifactId>ouath2-client</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>ouath2-client</name>
<build>
<finalName>predictouath2client</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
<azure.version>2.1.2</azure.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-active-directory-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-jose</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
<version>1.3.8.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security.oauth.boot/spring-security-oauth2-autoconfigure -->
<dependency>
<groupId>org.springframework.security.oauth.boot</groupId>
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-spring-boot-bom</artifactId>
<version>${azure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
and the WebSecurityConfig looks like:-
#EnableWebSecurity
#EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
#Autowired
private OAuth2UserService<OidcUserRequest, OidcUser> oidcUserService;
#Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.anyRequest().authenticated()
.and()
.oauth2Login()
.userInfoEndpoint()
.oidcUserService(oidcUserService);
}
the application.yaml looks like:-
spring:
security:
oauth2:
client:
registration:
azure:
client-id: xxxxxxxxxxxxxxxx
client-secret: xxxxxxxxxxxxxxxx
client-authentication-method: basic
authorization-grant-type: authorization_code
redirect-uri-template: '{baseUrl}/login/oauth2/code/{registrationId}'
scope: openid, https://graph.microsoft.com/user.read
client-name: Microsoft Azure
client-alias: azure
provider:
azure:
authorization-uri: https://login.microsoftonline.com/xxxxxxxxxxxxxx/oauth2/authorize
token-uri: https://login.microsoftonline.com/xxxxxxxxxxxxxx/oauth2/token
user-info-uri: https://login.microsoftonline.com/xxxxxxxxxxxxxx/openid/userinfo
jwk-set-uri: https://login.microsoftonline.com/xxxxxxxxxxxxxx/discovery/keys
user-name-attribute: name
azure:
activedirectory:
tenant-id: xxxxxxxxxxxxxx
active-directory-groups: Users
The detail error from the log files is
2019-02-08 05:48:28.612 DEBUG 99981 --- [nio-8010-exec-4] o.s.web.client.RestTemplate : Response 401 UNAUTHORIZED
2019-02-08 05:48:28.619 DEBUG 99981 --- [nio-8010-exec-4] .s.a.DefaultAuthenticationEventPublisher : No event was found for the exception org.springframework.security.oauth2.core.OAuth2AuthenticationException
2019-02-08 05:48:28.620 DEBUG 99981 --- [nio-8010-exec-4] .s.o.c.w.OAuth2LoginAuthenticationFilter : Authentication request failed: org.springframework.security.oauth2.core.OAuth2AuthenticationException: [invalid_token_response] An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: 401 Unauthorized
org.springframework.security.oauth2.core.OAuth2AuthenticationException: [invalid_token_response] An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: 401 Unauthorized
at org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider.authenticate(OidcAuthorizationCodeAuthenticationProvider.java:143) ~[spring-security-oauth2-client-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:175) ~[spring-security-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter.attemptAuthentication(OAuth2LoginAuthenticationFilter.java:186) ~[spring-security-oauth2-client-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]