batchee-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (BATCHEE-124) RequestScoped ContextNotActiveException in CLI
Date Mon, 20 Nov 2017 15:43:00 GMT

     [ https://issues.apache.org/jira/browse/BATCHEE-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Struberg reassigned BATCHEE-124:
-------------------------------------

    Assignee: Mark Struberg

> RequestScoped ContextNotActiveException in CLI
> ----------------------------------------------
>
>                 Key: BATCHEE-124
>                 URL: https://issues.apache.org/jira/browse/BATCHEE-124
>             Project: BatchEE
>          Issue Type: Bug
>          Components: batchee-cli
>            Reporter: Alexander Falb
>            Assignee: Mark Struberg
>
> When starting a batch via the batchee-cli runner (with batchee-cdi.jar in lib/ and {{openejb.scan.webapp.container=true}})
I get a ContextNotActiveException for RequestScoped beans.
> {code}
> public class EntityManagerProducer {
>     @PersistenceUnit(unitName = "unitname") private EntityManagerFactory emf;
>     @Produces @Request public EntityManager createEntityManager() {
>         return emf.createEntityManager();
>     }
> }
> public class MyReader implements ItemReader {
>     @Inject EntityManager em;
> }
> {code}
> results in:
> {code}
> Caused by: javax.enterprise.context.ContextNotActiveException: WebBeans context with
scope type annotation @RequestScoped does not exist within current thread
>         at org.apache.webbeans.container.BeanManagerImpl.getContext(BeanManagerImpl.java:335)
>         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:89)
>         at org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:71)
>         at org.apache.webbeans.custom.persistence.EntityManager$$OwbNormalScopeProxy0.createNativeQuery(javax/persistence/EntityManager.java)
>         at at.customer.testbatch.SomeStatistikReader.doRead(SomeStatistikReader.java:56)
>         at at.customer.testbatch.SomeStatistikReader.doRead(SomeStatistikReader.java:20)
>         at org.apache.batchee.extras.typed.TypedItemReader.readItem(TypedItemReader.java:40)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         at org.apache.batchee.container.proxy.BatchProxyInvocationHandler.invoke(BatchProxyInvocationHandler.java:55)
>         at com.sun.proxy.$Proxy86.readItem(Unknown Source)
>         at org.apache.batchee.container.impl.controller.chunk.ChunkStepController.readItem(ChunkStepController.java:284)
>         ... 16 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message