Не удалось найти компонент ScheduledExecutorService по умолчанию с Redis и Spring

Я только что разработал конфигурацию с помощью Spring Session и Redis, все работает нормально, но в журналах моей консоли я получил

 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

Как настроить bean-компонент ScheduledExecutorService?

Обновлять :

   @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;
}

person nole    schedule 29.06.2015    source источник
comment
Вопрос и так слишком широк. Предоставьте свой applicationContext.xml и/или класс @Configuration.   -  person Fritz Duchardt    schedule 29.06.2015


Ответы (1)


это сообщение DEBUG, его можно игнорировать, установив свой logging.level.org.springframework=INFO

Используется @Scheduled и @EnableScheduling, но выдается исключение NoSuchBeanDefinitionException

person Thang Hoang    schedule 14.09.2015