yes:
1. Error is:
AnnotationConfigServletWebServerApplicationContext:559 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]: Unsatisfied dependency expressed through method 'sessionRepositoryFilterRegistration' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConfig' defined in VFS resource ["/com/example/redis/RedisConfig.class"]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [com/example/redis/RedisConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.VerifyError: Bad return type
Exception Details:
Location:
org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createRedisSentinelPool(Lorg/springframework/data/redis/connection/RedisSentinelConfiguration;)Lredis/clients/jedis/util/Pool; @67: areturn
Reason:
Type 'redis/clients/jedis/JedisSentinelPool' (current frame, stack[0]) is not assignable to 'redis/clients/jedis/util/Pool' (from method signature)
Current Frame:
bci: @67
flags: { }
locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory', 'org/springframework/data/redis/connection/RedisSentinelConfiguration', 'org/apache/commons/pool2/impl/GenericObjectPoolConfig' }
stack: { 'redis/clients/jedis/JedisSentinelPool' }
Bytecode:
0x0000000: 2ab6 0055 c600 0a2a b600 55a7 000a bb00
0x0000010: 1559 b700 164d bb00 5659 2bb6 0057 b900
0x0000020: 5801 002a 2bb6 0059 b700 5a2c 2ab7 002c
0x0000030: 2ab7 002d 2ab6 005b 2ab6 003e 2ab6 005c
0x0000040: b700 5db0
Stackmap Table:
same_frame(@14)
same_locals_1_stack_item_frame(@21,Object[#267])
2. When I try:
@Bean
public static JedisConnectionFactory redisConnectionFactory() {
try {
log.info("
Inside block try");
return new JedisConnectionFactory(redisStandaloneConfiguration(), clientConfiguration());
}catch(Exception e) {
log.info("
Return null because failed");
return null;
}
}
Error is:
RedisConfig:70 - Inside block try |#]
AnnotationConfigServletWebServerApplicationContext:559 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sessionRepositoryFilterRegistration' defined in class path resource [org/springframework/boot/autoconfigure/session/SessionRepositoryFilterConfiguration.class]: Unsatisfied dependency expressed through method 'sessionRepositoryFilterRegistration' parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConfig' defined in VFS resource ["/com/example/redis/RedisConfig.class"]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [com/example/redis/RedisConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.VerifyError: Bad return type
Exception Details:
Location:
org/springframework/data/redis/connection/jedis/JedisConnectionFactory.createRedisSentinelPool(Lorg/springframework/data/redis/connection/RedisSentinelConfiguration;)Lredis/clients/jedis/util/Pool; @67: areturn
Reason:
Type 'redis/clients/jedis/JedisSentinelPool' (current frame, stack[0]) is not assignable to 'redis/clients/jedis/util/Pool' (from method signature)
Current Frame:
bci: @67
flags: { }
locals: { 'org/springframework/data/redis/connection/jedis/JedisConnectionFactory', 'org/springframework/data/redis/connection/RedisSentinelConfiguration', 'org/apache/commons/pool2/impl/GenericObjectPoolConfig' }
stack: { 'redis/clients/jedis/JedisSentinelPool' }
Bytecode:
0x0000000: 2ab6 0055 c600 0a2a b600 55a7 000a bb00
0x0000010: 1559 b700 164d bb00 5659 2bb6 0057 b900
0x0000020: 5801 002a 2bb6 0059 b700 5a2c 2ab7 002c
0x0000030: 2ab7 002d 2ab6 005b 2ab6 003e 2ab6 005c
0x0000040: b700 5db0
Stackmap Table:
same_frame(@14)
same_locals_1_stack_item_frame(@21,Object[#267])