Не удалось запустить весеннюю сессию с Hazelcast, исключение:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.springframework.session.hazelcast.config.annotation.web.http.HazelcastHttpSessionConfiguration':
Injection of autowired dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException:
Could not autowire method: public void org.springframework.session.hazelcast.config.annotation.web.http.HazelcastHttpSessionConfiguration.setHazelcastInstance(org.springframework.beans.factory.ObjectProvider,org.springframework.beans.factory.ObjectProvider);
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [org.springframework.beans.factory.ObjectProvider] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
Dependency annotations: {@org.springframework.session.hazelcast.config.annotation.SpringSessionHazelcastInstance()}
Я работал на том же примере в весенней сессии ссылка , но с использованием XML-конфурации, и уже имею
<context:annotation-config />
в appContext.xml
@EnableHazelcastHttpSession
@Configuration
public class SessionConfig {
@Bean
public HazelcastInstance hazelcastInstance() {
MapAttributeConfig attributeConfig = new MapAttributeConfig()
.setName(HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE)
.setExtractor(PrincipalNameExtractor.class.getName());
Config config = new Config();
config.getMapConfig(HazelcastSessionRepository.DEFAULT_SESSION_MAP_NAME)
.addMapAttributeConfig(attributeConfig)
.addMapIndexConfig(new MapIndexConfig(
HazelcastSessionRepository.PRINCIPAL_NAME_ATTRIBUTE, false));
return Hazelcast.newHazelcastInstance(config);
}
}
Версии:
Java 1.8 - весна 4.3.3 - весенняя сессия 2.0.2 - Hazelcast 3.9
Спасибо