문제

Getting a @SessionScoped CDI bean from inside a Filter is relatively easy. But trying to inject a @ConversationScoped bean throws the following error:

org.jboss.weld.context.ContextNotActiveException:
WELD-001303 No active contexts for scope type javax.enterprise.context.ConversationScoped

This is independent of whether or not a conversation is currently active. It seems like CDI can not determine whether a transient or active conversation should be used because my filter happens before whatever provides the context for @ConversationScoped beans.

What kind of filter / interception mechanism could be used that happens "late enough"?

도움이 되었습니까?

해결책

I'm not sure how other implementations do this, but at least Weld uses a Filter itself to handle conversations, so your filter would need to be after that one in the filter chain.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top