Spring Cloud Gateway Failed to start: Unable to find GatewayFilterFactory with name <blank> - spring

Spring Cloud Gateway failed to start, and gives the following exception:
service-gateway | 2020-01-02 13:44:55.910 INFO 22 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
service-gateway | 2020-01-02 13:44:55.915 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1577943895914 with initial instances count: 11
service-gateway | 2020-01-02 13:44:55.916 INFO 22 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application SERVICE-GATEWAY with eureka with status UP
service-gateway | 2020-01-02 13:44:55.917 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1577943895917, current=UP, previous=STARTING]
service-gateway | 2020-01-02 13:44:55.923 INFO 22 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790: registering service...
service-gateway | 2020-01-02 13:44:55.991 INFO 22 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790 - registration status: 204
service-gateway | 2020-01-02 13:44:56.051 WARN 22 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name
service-gateway | 2020-01-02 13:44:56.083 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
service-gateway | 2020-01-02 13:44:59.085 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : Unregistering ...
service-gateway | 2020-01-02 13:44:59.093 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790 - deregister status: 200
service-gateway | 2020-01-02 13:44:59.104 INFO 22 --- [ main] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient

In spring cloud gateway code that used to create filter it says:
GatewayFilterFactory factory = this.gatewayFilterFactories.get(definition.getName());
if (factory == null) {
throw new IllegalArgumentException("Unable to find GatewayFilterFactory with name " + definition.getName());
}
so if it failed to to create the gatewayFilterFactory, the exception should gives a message:
"Unable to find GatewayFilterFactory with name <some name>", But there is no such thing in my log, just "Unable to find GatewayFilterFactory with name ". After 2 days of research and I finally found, there is an error in my config file:
- id: api_assets
uri: lb://BACKEND
predicates:
- Path=/api/assets/**
filters:
- name: AuditFilter
-
A LIST OF FILTER NAMES WITH A BLANK ONE

Related

Inside docker container Eureka doesn't see the defaultZone parameter value in properties.yml

There are no problems happens if I'm launching apps without containers. My temporary solution is to send the parameter through environment variable, but I can't understand why does it work like this. Could somebody please explain what am I doing wrong?
application-docker.yml (api-gateway)
server:
port: 8080
spring:
application:
name: api-gateway
cloud:
gateway:
routes:
- id: customer
uri: lb://CUSTOMER
predicates:
- Path=/api/v1/customers/**
zipkin:
base-url: http://zipkin:9411/
eureka:
client:
serviceUrl:
defaultZone: http://eureka-server:8761/eureka/
fetch-registry: true
register-with-eureka: true
application-docker.yml (eureka-server)
server:
port: 8761
spring:
application:
name: eureka-server
zipkin:
base-url: http://zipkin:9411/
eureka:
client:
fetch-registry: false
register-with-eureka: false
docker-compose.yaml
services:
postgres:
container_name: postgres
image: postgres
environment:
POSTGRES_USER: *
POSTGRES_PASSWORD: *
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
networks:
- postgres
restart: unless-stopped
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
- "9411:9411"
networks:
- spring
rabbitmq:
image: rabbitmq:3.9.11-management-alpine
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
networks:
- spring
eureka-server:
image: ftmpt/eureka-server:latest
container_name: eureka-server
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "8761:8761"
networks:
- spring
depends_on:
- zipkin
api-gateway:
image: ftmpt/api-gateway:latest
container_name: api-gateway
environment:
- SPRING_PROFILES_ACTIVE=docker
# - eureka.client.service-url.defaultZone=http://eureka-server:8761/eureka
ports:
- "8080:8080"
networks:
- spring
- postgres
depends_on:
- eureka-server
- zipkin
networks:
postgres:
driver: bridge
spring:
driver: bridge
volumes:
postgres:
logs from api-gateway container:
Powered by Spring Boot 2.5.7
2022-10-03 16:19:28.632 INFO [api-gateway,,] 1 --- [ main] e.fatumepta.apigw.ApiGatewayApplication : Starting ApiGatewayApplication using Java 17.0.1 on f492a34f31a2 with PID 1 (/app/classes started by root in /)
2022-10-03 16:19:28.640 INFO [api-gateway,,] 1 --- [ main] e.fatumepta.apigw.ApiGatewayApplication : The following profiles are active: docker
2022-10-03 16:19:31.883 INFO [api-gateway,,] 1 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=7282d2ab-5b80-3882-a881-0bf42ac5f5e5
2022-10-03 16:19:32.624 INFO [api-gateway,,] 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-03 16:19:32.638 INFO [api-gateway,,] 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig' of type [org.springframework.cloud.client.loadbalancer.reactive.LoadBalancerBeanPostProcessorAutoConfiguration$ReactorDeferringLoadBalancerFilterConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-03 16:19:32.647 INFO [api-gateway,,] 1 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'reactorDeferringLoadBalancerExchangeFilterFunction' of type [org.springframework.cloud.client.loadbalancer.reactive.DeferringLoadBalancerExchangeFilterFunction] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query]
2022-10-03 16:19:34.880 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody]
2022-10-03 16:19:34.881 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr]
2022-10-03 16:19:34.881 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight]
2022-10-03 16:19:34.881 INFO [api-gateway,,] 1 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService]
2022-10-03 16:19:36.003 INFO [api-gateway,,] 1 --- [ main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses RestTemplate.
2022-10-03 16:19:36.316 WARN [api-gateway,,] 1 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2022-10-03 16:19:36.509 INFO [api-gateway,,] 1 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2022-10-03 16:19:36.782 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2022-10-03 16:19:36.800 INFO [api-gateway,,] 1 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2022-10-03 16:19:36.843 INFO [api-gateway,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2022-10-03 16:19:37.584 INFO [api-gateway,,] 1 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}, exception=I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused stacktrace=org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8761/eureka/apps/": Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused; nested exception is org.apache.http.conn.HttpHostConnectException: Connect to localhost:8761 [localhost/127.0.0.1] failed: Connection refused
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)
at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplicationsInternal(RestTemplateEurekaHttpClient.java:145)
at org.springframework.cloud.netflix.eureka.http.RestTemplateEurekaHttpClient.getApplications(RestTemplateEurekaHttpClient.java:135)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.executeOnNewServer(RedirectingEurekaHttpClient.java:121)
at com.netflix.discovery.shared.transport.decorator.RedirectingEurekaHttpClient.execute(RedirectingEurekaHttpClient.java:80)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:120)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$6.execute(EurekaHttpClientDecorator.java:137)
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.getApplications(EurekaHttpClientDecorator.java:134)
at com.netflix.discovery.DiscoveryClient.getAndStoreFullRegistry(DiscoveryClient.java:1101)
at com.netflix.discovery.DiscoveryClient.fetchRegistry(DiscoveryClient.java:1014)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:441)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:283)
at com.netflix.discovery.DiscoveryClient.<init>(DiscoveryClient.java:279)
at org.springframework.cloud.netflix.eureka.CloudEurekaClient.<init>(CloudEurekaClient.java:66)
at org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration$RefreshableEurekaClientConfiguration.eurekaClient(EurekaClientAutoConfiguration.java:295)
eureka-server logs from container
2022-10-06 11:46:06.693 INFO [eureka-server,,] 1 --- [ main] e.f.eureka.EurekaServerApplication : Starting EurekaServerApplication using Java 17.0.1 on bf39ca283c65 with PID 1 (/app/classes started by root in /)
2022-10-06 11:46:06.727 INFO [eureka-server,,] 1 --- [ main] e.f.eureka.EurekaServerApplication : The following profiles are active: docker
2022-10-06 11:46:10.568 INFO [eureka-server,,] 1 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=c87a0e94-d419-31a3-a4bc-1879ab705f9c
2022-10-06 11:46:12.271 INFO [eureka-server,,] 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8761 (http)
2022-10-06 11:46:12.311 INFO [eureka-server,,] 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-10-06 11:46:12.311 INFO [eureka-server,,] 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55]
2022-10-06 11:46:12.604 INFO [eureka-server,,] 1 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-10-06 11:46:12.604 INFO [eureka-server,,] 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 5728 ms
2022-10-06 11:46:15.226 INFO [eureka-server,,] 1 --- [ main] c.s.j.s.i.a.WebApplicationImpl : Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'
2022-10-06 11:46:15.401 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2022-10-06 11:46:15.402 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2022-10-06 11:46:15.755 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2022-10-06 11:46:15.755 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2022-10-06 11:46:18.003 INFO [eureka-server,,] 1 --- [ main] DiscoveryClientOptionalArgsConfiguration : Eureka HTTP Client uses Jersey
2022-10-06 11:46:18.261 WARN [eureka-server,,] 1 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
2022-10-06 11:46:18.274 INFO [eureka-server,,] 1 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2022-10-06 11:46:18.293 INFO [eureka-server,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2022-10-06 11:46:18.295 INFO [eureka-server,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Client configured to neither register nor query for data.
2022-10-06 11:46:18.300 INFO [eureka-server,,] 1 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1665056778299 with initial instances count: 0
2022-10-06 11:46:18.396 INFO [eureka-server,,] 1 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initializing ...
2022-10-06 11:46:18.405 INFO [eureka-server,,] 1 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Adding new peer nodes [http://localhost:8761/eureka/]
2022-10-06 11:46:18.857 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2022-10-06 11:46:18.857 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2022-10-06 11:46:18.857 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2022-10-06 11:46:18.857 INFO [eureka-server,,] 1 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2022-10-06 11:46:19.589 INFO [eureka-server,,] 1 --- [ main] c.n.eureka.cluster.PeerEurekaNodes : Replica node URL: http://localhost:8761/eureka/
2022-10-06 11:46:19.608 INFO [eureka-server,,] 1 --- [ main] c.n.e.registry.AbstractInstanceRegistry : Finished initializing remote region registries. All known remote regions: []
2022-10-06 11:46:19.609 INFO [eureka-server,,] 1 --- [ main] c.n.eureka.DefaultEurekaServerContext : Initialized
2022-10-06 11:46:19.855 INFO [eureka-server,,] 1 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2022-10-06 11:46:19.953 INFO [eureka-server,,] 1 --- [ main] o.s.c.n.e.s.EurekaServiceRegistry : Registering application EUREKA-SERVER with eureka with status UP
2022-10-06 11:46:19.978 INFO [eureka-server,,] 1 --- [ Thread-9] o.s.c.n.e.server.EurekaServerBootstrap : Setting the eureka configuration..
2022-10-06 11:46:19.991 INFO [eureka-server,,] 1 --- [ Thread-9] o.s.c.n.e.server.EurekaServerBootstrap : isAws returned false
2022-10-06 11:46:20.008 INFO [eureka-server,,] 1 --- [ Thread-9] o.s.c.n.e.server.EurekaServerBootstrap : Initialized server context
2022-10-06 11:46:20.008 INFO [eureka-server,,] 1 --- [ Thread-9] c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
2022-10-06 11:46:20.008 INFO [eureka-server,,] 1 --- [ Thread-9] c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 1
2022-10-06 11:46:20.008 INFO [eureka-server,,] 1 --- [ Thread-9] c.n.e.r.PeerAwareInstanceRegistryImpl : Changing status to UP
2022-10-06 11:46:20.034 INFO [eureka-server,,] 1 --- [ Thread-9] e.s.EurekaServerInitializerConfiguration : Started Eureka Server
2022-10-06 11:46:20.034 INFO [eureka-server,,] 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8761 (http) with context path ''
2022-10-06 11:46:20.035 INFO [eureka-server,,] 1 --- [ main] .s.c.n.e.s.EurekaAutoServiceRegistration : Updating port to 8761
2022-10-06 11:46:20.089 INFO [eureka-server,,] 1 --- [ main] e.f.eureka.EurekaServerApplication : Started EurekaServerApplication in 14.267 seconds (JVM running for 14.702)

Keycloak Ouath2 integration is not working in spring cloud dataflow 2.3.0

I am currently trying to integrate keycloak with spring cloud dataflow 2.3.0 but the configurations are showing in the documentation is not working for this version. I tried the same with version spring cloud dataflow 2.2.2 and the integrations worked okay. This the config I am added in application.yaml for both the versions,
spring:
cloud:
dataflow:
security:
authorization:
map-oauth-scopes: true
security:
oauth2:
client:
client-id: dataflow
client-secret: 44ed8e53-f52f-4d2e-a205
access-token-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/token
user-authorization-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/auth
resource:
user-info-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/userinfo
token-info-uri: http://localhost:8080/auth/realms/dataflow/protocol/openid-connect/token/introspect
I can see the below entries in the 2.2.2 logs after the config is applied but not in 2.3.0
2020-10-18 11:31:40.829 INFO 1 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL95Dialect
2020-10-18 11:31:40.977 INFO 1 --- [ main] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType#5965844d
2020-10-18 11:31:42.027 INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-10-18 11:31:43.113 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/about'
2020-10-18 11:31:43.114 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/audit-records'
2020-10-18 11:31:43.121 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/audit-records/**'
2020-10-18 11:31:43.122 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_MANAGE')' | '/management/**'
2020-10-18 11:31:43.122 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/apps'
2020-10-18 11:31:43.122 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'GET' | 'hasRole('ROLE_VIEW')' | '/apps/**'
2020-10-18 11:31:43.123 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'DELETE' | 'hasRole('ROLE_DESTROY')' | '/apps/**'
2020-10-18 11:31:43.123 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'POST' | 'hasRole('ROLE_CREATE')' | '/apps'
2020-10-18 11:31:43.123 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'POST' | 'hasRole('ROLE_CREATE')' | '/apps/**'
2020-10-18 11:31:43.124 INFO 1 --- [ main] o.s.c.c.s.support.SecurityConfigUtils : Authorization 'PUT' | 'hasRole('ROLE_MODIFY')' | '/apps/**'
I have followed the details in here https://docs.spring.io/spring-cloud-dataflow/docs/2.3.0.RELEASE/reference/htmlsingle/#configuration-security-oauth2 and don't understand why it's not working in 2.3.0. Is anyone able to successfully integrate dataflow version 2.3.0 above with keycloak ( not UAA)?. Also, I am using keycloak for SSO and no user registration required.
The configurations are changed from the version 2.3.0 which is not documented in the dataflow documentations. I have added only the keycloak related configuration in github https://github.com/ChimbuChinnadurai/spring-cloud-dataflow-keycloak-integration

spring cloud gateway exception Illegal character in authority at index error

I'm trying to setup spring cloud gateway for a api, but seeing an illegal argument exception with the route uri. Any help is appreciated.
Running this app on Ubuntu and I got the same exception with both Spring boot 2.1.4 and 2.1.5.
This is how configured my application.properties file in the gateway app.
eureka.client.serviceUrl.defaultZone = http://localhost:8761/eureka
spring.application.name= api-gateway
spring.cloud.gateway.discovery.locator.enabled=true
spring.cloud.gateway.discovery.locator.lowerCaseServiceId=true
spring.cloud.gateway.routes[0].id=reporting-service
spring.cloud.gateway.routes[0].uri = lb://reporting-service
spring.cloud.gateway.routes[0].predicates[0]=Path=/api/reporting/**
This is the exception that I see.
2019-06-06 09:56:17.304 WARN 4561 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initializ ation - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Illegal character in authority at in dex 5: lb://REPORTING-SERVICE
2019-06-06 09:56:17.316 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2019-06-06 09:56:20.317 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Unregistering ...
2019-06-06 09:56:20.324 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : DiscoveryClient_API-GATEWAY/apitest.****.*****.com:api-gateway:8080 - deregister status: 200
2019-06-06 09:56:20.342 INFO 4561 --- [ main] com.netflix.discovery.DiscoveryClient : Completed shut down of DiscoveryClient
2019-06-06 09:56:20.353 INFO 4561 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-06 09:56:20.365 ERROR 4561 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Ex ceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Illegal character in authority at index 5: lb://REPORTING-SERVICE
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:185) ~[spring-context-5.1.6.RELEAS E.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:53) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:360) ~[spring-context -5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:158) ~[spring-context-5.1.6.REL EASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:122) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:893) ~[spring-context-5.1. 6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.finishRefresh(ReactiveWebServerApplicationContext.jav a:121) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.1.6.RELE ASE.jar!/:5.1.6.RELEASE]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:67) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
Fix the property:
spring.cloud.gateway.routes[0].predicates=Path=/api/reporting/**
spring.cloud.gateway.routes[0].uri=lb://reporting-service
Reference : issue-56480485

Hazelcast cluster not available on Eureka

I had a problem configuring simple Hazelcast cluster for existing Eureka client.
My application is simple Java SpringBoot application with Eureka discovery enabled, it is properly available for Eureka, however Hazelcast cluster is not.
This is my configuration:
hazelcast.xml
<hazelcast
xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.9.xsd"
xmlns="http://www.hazelcast.com/schema/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<properties>
<property name="hazelcast.discovery.enabled">true</property>
<property name="hazelcast.jmx">true</property>
<property name="hazelcast.http.healthcheck.enabled">true</property>
<property name="hazelcast.rest.enabled">true</property>
<property name="hazelcast.logging.type">slf4j</property>
<property name="hazelcast.diagnostics.enabled">true</property>
<property name="hazelcast.diagnostics.metric.level">info</property>
<property name="hazelcast.name">hazelcast-cluster</property>
</properties>
<group>
<name>xxxx</name>
<password>xx</password>
</group>
<instance-name>hazelcast-cluster</instance-name>
<network>
<join>
<multicast enabled="false"/>
<tcp-ip enabled="false"/>
<aws enabled="false"/>
<discovery-strategies>
<discovery-strategy class="com.hazelcast.eureka.one.EurekaOneDiscoveryStrategy" enabled="true">
<properties>
<property name="self-registration">true</property>
<property name="namespace">hazelcast</property>
</properties>
</discovery-strategy>
</discovery-strategies>
</join>
</network>
maps....
</hazelcast>
Spring boot application:
#SpringBootApplication
#EnableAutoConfiguration ( exclude = { WebMvcAutoConfiguration.class } )
#EnableDiscoveryClient
#EnableEurekaClient
public class HazelcastClusterApplication {
public static void main( String[] args ) {
SpringApplication.run( HazelcastClusterApplication.class, args );
}
}
Configuration class:
#Configuration
public class HazelcastInstanceConfiguration {
#Bean
public HazelcastInstance hazelcastInstance(Config config, EurekaClient eurekaClient) {
EurekaOneDiscoveryStrategyFactory.setEurekaClient( eurekaClient );
return Hazelcast.newHazelcastInstance(config);
}
#Bean
public Config config() {
Config config = new ClasspathXmlConfig( "hazelcast.xml" );
return config;
}
}
bootstrap.yml
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8011/eureka/
register-with-eureka: true
spring:
mvc:
favicon:
enabled: false
application:
name: cache-server
cloud:
config:
discovery:
enabled: true
serviceId: config-server
failFast: false
retry:
initialInterval: 10000
maxInterval: 60000
maxAttempts: 12
multiplier: 10.1
config:
name: application.*, ${spring.application.name}*.*
server:
port: 7990
Maven dependencies:
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-eureka-one</artifactId>
<version>1.0.2</version>
</dependency>
After running, 'cache-server' application is available on Eureka, however I guess also 'hazelcast-cluster' should be available, but it is not. Or my assumption is wrong?
Startup logs:
INFO 17628 --- [ main] c.h.s.d.integration.DiscoveryService : [10.230.115.128]:5701 [xxxx] [3.11] Waiting for registration with Eureka...
INFO 17628 --- [ main] c.h.s.d.integration.DiscoveryService : [10.230.115.128]:5701 [xxxx] [3.11] Waiting for registration with Eureka...
INFO 17628 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CACHE-SERVER/pc_data:cache-server:7990: registering service...
INFO 17628 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_CACHE-SERVER/pc_data:cache-server:7990 - registration status: 204
INFO 17628 --- [ main] c.h.s.d.integration.DiscoveryService : [10.230.115.128]:5701 [xxxx] [3.11] Waiting for registration with Eureka...
DEBUG 17628 --- [ main] c.h.i.cluster.impl.DiscoveryJoiner : [10.230.115.128]:5701 [xxxx] [3.11] This node will assume master role since no possible member where connected to.
DEBUG 17628 --- [ main] c.h.internal.cluster.ClusterService : [10.230.115.128]:5701 [xxxx] [3.11] Setting master address to [10.230.115.128]:5701
DEBUG 17628 --- [ main] c.h.i.cluster.impl.MembershipManager : [10.230.115.128]:5701 [xxxx] [3.11] Local member list join version is set to 1
DEBUG 17628 --- [ main] c.h.i.cluster.impl.DiscoveryJoiner : [10.230.115.128]:5701 [xxxx] [3.11] PostJoin master: [10.230.115.128]:5701, isMaster: true
INFO 17628 --- [ main] c.h.internal.cluster.ClusterService : [10.230.115.128]:5701 [xxxx] [3.11]
Members {size:1, ver:1} [
Member [10.230.115.128]:5701 - f6ed031e-5740-4daa-b583-5b91d98816c2 this
]
And then my cache-server application is available on Eureka, but not hazelcast-cluster as I guess it should.
Hazelcast client service logs (cutted):
2018-12-11 09:48:01.673 INFO [security-service,,,] 21496 --- [ main] com.hazelcast.client.HazelcastClient : hz.client_0 [xxxx] [3.11] A non-empty group password is configured for the Hazelcast client. Starting with Hazelcast version 3.11, clients with the same group name, but with different group passwords (that do not use authentication) will be accepted to a cluster. The group password configuration will be removed completely in a future release.
2018-12-11 09:48:01.700 INFO [security-service,,,] 21496 --- [ main] com.hazelcast.core.LifecycleService : hz.client_0 [xxxx] [3.11] HazelcastClient 3.11 (20181023 - 1500bbb) is STARTING
2018-12-11 09:48:03.233 INFO [security-service,,,] 21496 --- [ main] o.s.c.n.eureka.InstanceInfoFactory : Setting initial instance status as: STARTING
2018-12-11 09:48:03.249 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Initializing Eureka in region us-east-1
2018-12-11 09:48:03.264 INFO [security-service,,,] 21496 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON encoding codec LegacyJacksonJson
2018-12-11 09:48:03.266 INFO [security-service,,,] 21496 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using JSON decoding codec LegacyJacksonJson
2018-12-11 09:48:03.267 INFO [security-service,,,] 21496 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML encoding codec XStreamXml
2018-12-11 09:48:03.267 INFO [security-service,,,] 21496 --- [ main] c.n.d.provider.DiscoveryJerseyProvider : Using XML decoding codec XStreamXml
2018-12-11 09:48:03.417 INFO [security-service,,,] 21496 --- [ main] c.n.d.s.r.aws.ConfigClusterResolver : Resolving eureka endpoints via configuration
2018-12-11 09:48:03.421 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Disable delta property : false
2018-12-11 09:48:03.421 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Single vip registry refresh property : null
2018-12-11 09:48:03.422 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Force full registry fetch : false
2018-12-11 09:48:03.422 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Application is null : false
2018-12-11 09:48:03.423 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Registered Applications size is zero : true
2018-12-11 09:48:03.424 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Application version is -1: true
2018-12-11 09:48:03.424 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Getting all instance registry info from the eureka server
2018-12-11 09:48:03.426 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : The response status is 200
2018-12-11 09:48:03.426 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Starting heartbeat executor: renew interval is: 5
2018-12-11 09:48:03.426 INFO [security-service,,,] 21496 --- [ main] c.n.discovery.InstanceInfoReplicator : InstanceInfoReplicator onDemand update allowed rate per min is 4
2018-12-11 09:48:03.442 INFO [security-service,,,] 21496 --- [ main] com.netflix.discovery.DiscoveryClient : Discovery Client initialized at timestamp 1544518083442 with initial instances count: 3
2018-12-11 09:48:03.488 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:08.468 INFO [security-service,,,] 21496 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SECURITY-SERVICE/GPLPLW2002.gft.com:security-service:8035 - Re-registering apps/SECURITY-SERVICE
2018-12-11 09:48:08.468 INFO [security-service,,,] 21496 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SECURITY-SERVICE/GPLPLW2002.gft.com:security-service:8035: registering service...
2018-12-11 09:48:08.499 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:08.530 INFO [security-service,,,] 21496 --- [tbeatExecutor-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_SECURITY-SERVICE/GPLPLW2002.gft.com:security-service:8035 - registration status: 204
2018-12-11 09:48:13.500 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:18.503 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:23.512 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:28.513 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:33.515 INFO [security-service,,,] 21496 --- [ main] c.h.s.d.integration.DiscoveryService : hz.client_0 [xxxx] [3.11] Waiting for registration with Eureka...
2018-12-11 09:48:33.557 INFO [security-service,,,] 21496 --- [ main] c.h.client.spi.ClientInvocationService : hz.client_0 [xxxx] [3.11] Running with 2 response threads
2018-12-11 09:48:33.742 INFO [security-service,,,] 21496 --- [ main] com.hazelcast.core.LifecycleService : hz.client_0 [xxxx] [3.11] HazelcastClient 3.11 (20181023 - 1500bbb) is STARTED
2018-12-11 09:48:33.772 DEBUG [security-service,,,] 21496 --- [ main] c.h.i.networking.nio.NioNetworking : hz.client_0 [xxxx] [3.11] TcpIpConnectionManager configured with Non Blocking IO-threading model: 1 input threads and 1 output threads
2018-12-11 09:48:33.774 DEBUG [security-service,,,] 21496 --- [ main] c.h.i.networking.nio.NioNetworking : hz.client_0 [xxxx] [3.11] IO threads selector mode is SELECT
2018-12-11 09:48:33.818 WARN [security-service,,,] 21496 --- [ient_0.cluster-] c.h.c.c.ClientConnectionManager : hz.client_0 [xxxx] [3.11] Unable to get alive cluster connection, try in 3000 ms later, attempt 1 of 2.
2018-12-11 09:48:36.822 WARN [security-service,,,] 21496 --- [ient_0.cluster-] c.h.c.c.ClientConnectionManager : hz.client_0 [xxxx] [3.11] Unable to get alive cluster connection, attempt 2 of 2.
2018-12-11 09:48:36.824 WARN [security-service,,,] 21496 --- [ient_0.cluster-] c.h.c.c.ClientConnectionManager : hz.client_0 [xxxx] [3.11] Could not connect to cluster, shutting down the client. Unable to connect to any address! The following addresses were tried: []
2018-12-11 09:48:36.828 INFO [security-service,,,] 21496 --- [clientShutdown-] com.hazelcast.core.LifecycleService : hz.client_0 [xxxx] [3.11] HazelcastClient 3.11 (20181023 - 1500bbb) is SHUTTING_DOWN
2018-12-11 09:48:36.839 INFO [security-service,,,] 21496 --- [clientShutdown-] com.netflix.discovery.DiscoveryClient : Shutting down DiscoveryClient ...
2018-12-11 09:48:36.843 INFO [security-service,,,] 21496 --- [clientShutdown-] com.netflix.discovery.DiscoveryClient : Unregistering ...
2018-12-11 09:48:36.844 WARN [security-service,,,] 21496 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: o.....org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cacheManager' defined in class path resource
.......
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hazelcastInstance' defined in class path resource [xxxx/hazelcast/HazelcastClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Unable to connect to any address! The following addresses were tried: []
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
... 150 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.hazelcast.core.HazelcastInstance]: Factory method 'hazelcastInstance' threw exception; nested exception is java.lang.IllegalStateException: Unable to connect to any address! The following addresses were tried: []
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 163 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to connect to any address! The following addresses were tried: []
at com.hazelcast.client.connection.nio.ClusterConnector.connectToClusterInternal(ClusterConnector.java:206)
at com.hazelcast.client.connection.nio.ClusterConnector.access$400(ClusterConnector.java:56)
at com.hazelcast.client.connection.nio.ClusterConnector$2.call(ClusterConnector.java:215)
at com.hazelcast.client.connection.nio.ClusterConnector$2.call(ClusterConnector.java:211)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at com.hazelcast.util.executor.HazelcastManagedThread.executeRun(HazelcastManagedThread.java:64)
at com.hazelcast.util.executor.HazelcastManagedThread.run(HazelcastManagedThread.java:80)
What is wrong with my configuration, is this a server problem or client?
Client configuration:
#Bean
#Autowired
public HazelcastInstance hazelcastInstance( EurekaClient eurekaClient, GroupConfig groupConfig ) {
EurekaOneDiscoveryStrategyFactory.setEurekaClient( eurekaClient );
ClientConfig config = new ClientConfig();
config.setGroupConfig( groupConfig );
config.setProperty( "hazelcast.discovery.enabled", "true" );
DiscoveryStrategyConfig discoveryStrategyConfig = new DiscoveryStrategyConfig( new EurekaOneDiscoveryStrategyFactory() );
discoveryStrategyConfig.addProperty( "use-classpath-eureka-client-props", "false" );
discoveryStrategyConfig.addProperty( "self-registration", "false" );
DiscoveryConfig discoveryConfig = new DiscoveryConfig();
discoveryConfig.addDiscoveryStrategyConfig( discoveryStrategyConfig );
config.getNetworkConfig().setDiscoveryConfig( discoveryConfig );
return HazelcastClient.newHazelcastClient( config );
}
The problem is that you use the same EurekaClient for you app discovery (port 7990) and your Hazelcast discovery (port 5701). For more information, read the related GH issue.
You can solve it in two ways:
Use the property use-metadata-for-host-and-port as described here
Use separate Eureka Client and ports for your app and Hazelcast
EDIT: The use-metadata-for-host-and-port will be released in hazelcast-eureka:1.0.3 soon. I've also prepared Hazelcast Eureka Code Sample.
Have you seen the example configs in Eureka plugin repo and also the code sample with Eureka? I see there are some differences in the configs with yours. Please check and let me know if you still have problems.

Error registering service to eureka server

I am trying to register a client to spring-eureka-server, client deregisters just after registering
eureka-server logs:
2018-05-13 16:02:47.290 INFO 25557 --- [io-9091-exec-10]
c.n.e.registry.AbstractInstanceRegistry : Registered instance
HELLO-CLIENT/192.168.43.96:hello-client:8072 with status UP
(replication=false) 2018-05-13 16:02:47.438 INFO 25557 ---
[nio-9091-exec-3] c.n.e.registry.AbstractInstanceRegistry :
Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with
status DOWN (replication=false) 2018-05-13 16:02:47.457 INFO 25557
--- [nio-9091-exec-2] c.n.e.registry.AbstractInstanceRegistry : Cancelled instance HELLO-CLIENT/192.168.43.96:hello-client:8072
(replication=false) 2018-05-13 16:02:47.950 INFO 25557 ---
[nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry :
Registered instance HELLO-CLIENT/192.168.43.96:hello-client:8072 with
status DOWN (replication=true) 2018-05-13 16:02:47.951 INFO 25557 ---
[nio-9091-exec-5] c.n.e.registry.AbstractInstanceRegistry : Cancelled
instance HELLO-CLIENT/192.168.43.96:hello-client:8072
(replication=true) 2018-05-13 16:03:25.747 INFO 25557 ---
[a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running
the evict task with compensationTime 4ms
Eureka-client logs:
2018-05-13 16:02:47.163 INFO 25676 --- [nfoReplicator-0]
com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072:
registering service... 2018-05-13 16:02:47.212 INFO 25676 --- [
main] c.a.helloclient.HelloClientApplication : Started
HelloClientApplication in 7.62 seconds (JVM running for 8.573)
2018-05-13 16:02:47.224 INFO 25676 --- [ Thread-5]
s.c.a.AnnotationConfigApplicationContext : Closing
org.springframework.context.annotation.AnnotationConfigApplicationContext#6f7923a5:
startup date [Sun May 13 16:02:42 IST 2018]; parent:
org.springframework.context.annotation.AnnotationConfigApplicationContext#5c30a9b0
2018-05-13 16:02:47.226 INFO 25676 --- [ Thread-5]
o.s.c.n.e.s.EurekaServiceRegistry : Unregistering application
hello-client with eureka with status DOWN 2018-05-13 16:02:47.227
WARN 25676 --- [ Thread-5] com.netflix.discovery.DiscoveryClient
: Saw local status change event StatusChangeEvent
[timestamp=1526207567227, current=DOWN, previous=UP] 2018-05-13
16:02:47.232 INFO 25676 --- [ Thread-5]
o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2018-05-13 16:02:47.235 INFO 25676 --- [ Thread-5]
com.netflix.discovery.DiscoveryClient : Shutting down
DiscoveryClient ... 2018-05-13 16:02:47.292 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
registration status: 204 2018-05-13 16:02:47.423 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072:
registering service... 2018-05-13 16:02:47.440 INFO 25676 ---
[nfoReplicator-0] com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
registration status: 204 2018-05-13 16:02:47.442 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Unregistering ...
2018-05-13 16:02:47.460 INFO 25676 --- [ Thread-5]
com.netflix.discovery.DiscoveryClient :
DiscoveryClient_HELLO-CLIENT/192.168.43.96:hello-client:8072 -
deregister status: 200 2018-05-13 16:02:47.494 INFO 25676 --- [
Thread-5] com.netflix.discovery.DiscoveryClient : Completed shut
down of DiscoveryClient 2018-05-13 16:02:47.495 INFO 25676 --- [
Thread-5] o.s.j.e.a.AnnotationMBeanExporter : Unregistering
JMX-exposed beans on shutdown 2018-05-13 16:02:47.498 INFO 25676 ---
[ Thread-5] o.s.j.e.a.AnnotationMBeanExporter :
Unregistering JMX-exposed beans
Please let me know what could be possibly wrong.
Add
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
into Eureka and client app
It really works !!!
Eureka client deregisters when an app has been shutdown.
Check if there is any other reason why the app is stopping leading to eureka-client deregistering.
For my case, the application was shutting down due to spring-boot-starter-web dependency. After resolving this, the application started well.
Looks like a dependency issue.
If the app works fine (the core functionality) without eureka integration, then try changing the eureka-client dependency version.
I would suggest you to check the following:
Check all the port numbers that you are running
Check for any version issues
Add above web dependency in your eureka pom.xml (it worked for me in Maven projects)

Resources