WELD-001303 No active contexts for area type javax.enterprise.context.SessionScoped

I searched everything, anywhere, but it seems I can’t find a better answer to resolve this error, there is my stack trace, can someone tell me what is happening to me, I spent a couple of days to find this error .. ..: (

16:55:02,405 SEVERE [org.activiti.engine.impl.jobexecutor.TimerCatchIntermediateEventJobHandler] (Thread-16 (HornetQ-client-global-threads-982087879)) exception during timer execution: org.activiti.engine.ActivitiException: Exception while invoking TaskListener: WELD-001303 No active contexts for scope type javax.enterprise.context.SessionScoped
    at org.activiti.engine.impl.persistence.entity.TaskEntity.fireEvent(TaskEntity.java:529) [activiti-engine-5.11.jar:5.11]
    at ....
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.SessionScoped
    at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:598) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
    at com.metro.wfm.shared.cdi.OverrideUserBean$Proxy$_$$_WeldClientProxy.hasBean(OverrideUserBean$Proxy$_$$_WeldClientProxy.java) [wfm-shared-0.0.2.jar:]
    ... 168 more
+5
source share
3 answers

Session contexts are only active during servlet calls using the method service()or when performing a servlet filter. You do not know how you have configured Activiti to work, but it will not be in the active period of the session context. Thus, if you enter any beans for which it is required @SessionScoped, then the injection will fail.

bean, @SessionScoped, beans.

+5

, , , @Perception, , @Singleton (javax.ejb.Singleton) @Startup (javax.ejb.Startup) , bean, @SessionScoped bean, @SessionScoped, WELD-001303.

+2

I also ran into the same problem.

In my case, I used @javax.enterprise.context.SessionScoped CDI bean in an EJB timer that was executed using annotation @javax.ejb.Schedule. This obviously does not work, because the bean session is not running.

0
source

All Articles