Handler dispatch error when using RedisTokenStore #1221
Description
I'm trying to use RedisTokenStore as default token store but error raised when requesting on /oauth/token for new token. I'm using spring-boot:2.0.0.M5, spring-security-oauth2:2.2.0.RELEASE and spring-data-redis:2.0.1.RELEASE
Error body is:
Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set([B[B)V
and I guessed it's related to oauth module because:
Resolving exception from handler [public org.springframework.http.ResponseEntity<org.springframework.security.oauth2.common.OAuth2AccessToken> org.springframework.security.oauth2.provider.endpoint.TokenEndpoint.postAccessToken(java.security.Principal,java.util.Map<java.lang.String, java.lang.String>) throws org.springframework.web.HttpRequestMethodNotSupportedException]: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.set([B[B)V
Bean configurations is as follows:
@Bean public JedisConnectionFactory redisConnectionFactory() { RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(redisHostName, Integer.parseInt(redisPort)); return new JedisConnectionFactory(configuration); }
@Bean public TokenStore tokenStore() { return new RedisTokenStore(redisConnectionFactory()); }
I've also tested underlying redis connection and it works well.