Вопрос

I'm trying to make webapp which should use thymeleaf with spring controllers. But I'd like to have some CDI ConversationScoped beans injected into my Spring controller. For now I managed to configure CDI with my Spring application I when I tried to incject CDI bean into my controller it seems to work fine, but when I tried to inject Conversation bean it fails with error:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [javax.enterprise.context.Conversation] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.inject.Inject()}
Это было полезно?

Решение

In CDI 1.0 the conversation scope is tied to JSF. If you're not using JSF you won't be able to access the conversation scope. You could create another scope which mimics the conversation scope though.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top