Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-454

CDI scope conflicts until batch job finished

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.3.0.Final
    • jberet-core
    • None

    Description

      It was raised in stackoverflow:
      https://stackoverflow.com/questions/52519850/scope-conflicts-until-batch-job-finished

      Tech stack:

      JBeret (core, se) 1.3.0.Final
      Hibernate Search (orm, jsr352-core, jsr352-jberet) 5.10.4.Final
      Weld (servlet-core, se-core) 3.0.5.Final

      If I trigger

      BatchRuntime.getJobOperator().start(
      MassIndexingJob.NAME,
      MassIndexingJob.parameters().forEntity(getDomainObjectClass()).build()
      );

      then I had the situation that a can't access any CDI component outside of the batch job that are RequestScoped or SessionScoped, until the batch job is finished.

      How I can fix this problem?

      Part of the stacktrace

      Caused by: org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:647) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:164) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:131) ~[weld-core-impl-3.0.5.Final.jar:3.0.5.Final] at foo.bar.Baz$Proxy$_$$_WeldClientProxy.getFoo(Unknown Source) ~[classes/:na]

      Attachments

        Activity

          People

            weli@redhat.com Weinan Li
            cfang@redhat.com Cheng Fang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: