0

I have just develop a configuration with Spring Session and Redis, everything work fine, but in my console logs, I got

 2015-06-29 15:45:44,088 [main] DEBUG org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor -     Could not find default ScheduledExecutorService bean
 org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.scheduling.TaskScheduler] is defined

How can I configure ScheduledExecutorService bean?

Update :

   @Configuration
   @EnableRedisHttpSession
   @Conditional(RedisDeclarationCondition.class)
   public class LocalRedisConfig extends WebMVCConfig{


       @Value("${redis.host}")
       private String host;

       @Value("${redis.port}")
       private String port;

       @Bean
       public JedisConnectionFactory connectionFactory() {
         return new JedisConnectionFactory();
       }


@Bean
public RedisConnectionFactory jedisConnectionFactory(){
    JedisPoolConfig poolConfig = new JedisPoolConfig();
    poolConfig.setMaxIdle(5);
    poolConfig.setMaxTotal(10);
    poolConfig.setMinIdle(1);
    poolConfig.setTestOnBorrow(true);
    poolConfig.setTestOnReturn(true);
    poolConfig.setTestWhileIdle(true);
    JedisConnectionFactory jedisConnectionFactory = new                 JedisConnectionFactory(poolConfig);
  //        RedisOperationsSessionRepository cleanup = new RedisOperationsSessionRepository(jedisConnectionFactory);

        //optional 
        //jedisConnectionFactory.setHostName(host);
        //jedisConnectionFactory.setPort(Integer.valueOf(port));

        return jedisConnectionFactory;
}

@Bean
public StringRedisTemplate redisTemplate(){
    StringRedisTemplate redisTemplate = new StringRedisTemplate(jedisConnectionFactory());
    return redisTemplate;
}
nole
  • 1,422
  • 4
  • 20
  • 32

1 Answers1

0

it is a DEBUG message, could be ignored by set your logging.level.org.springframework=INFO

Using @Scheduled and @EnableScheduling but gives NoSuchBeanDefinitionException

Community
  • 1
  • 1
Thang Hoang
  • 250
  • 5
  • 22