我已经搜索了所有地方,但是似乎我找不到解决该错误的最佳答案,有我的堆栈跟踪信息,有人可以告诉我发生了什么事,我花了两秒钟的时间来查找此错误...。 :(
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
最佳答案
session 作用域上下文仅在使用service()
方法的servlet调用期间或在执行servlet过滤器时处于 Activity 状态。不确定您如何设置Activiti作业,但它似乎不在 session 上下文的有效期内。这样,如果您注入(inject)任何需要@SessionScoped
的bean,则注入(inject)将失败。
解决方案是删除需要@SessionScoped
的bean注入(inject)或修改bean。