AnsweredAssumed Answered

TimerBoundary Event using CDI bean

Question asked by kitkatboy on May 24, 2017

Hello,

 

I have timer boundary event which is connected with groovy script task. There is CDI bean invocation in groovy script (mailService bean call). Everything works fine on standalone wildfly. However, when I try to run this solution in domain mode, I get error:

Caused by: javax.script.ScriptException: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:326)
        at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:124)
        ... 74 more
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.ApplicationScoped
        at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:689)
        at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:90)
        at org.jboss.weld.bean.ContextualInstanceStrategy$ApplicationScopedContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:124)
        at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:83)
        at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)

 

I use wildfy 10. Bean has other ApplicationScoped beans injected. Could you please explain why it does not work? How to resolve it?

Outcomes