[
https://issues.apache.org/jira/browse/TOMEE-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904666#comment-15904666
]
Romain Manni-Bucau commented on TOMEE-2020:
-------------------------------------------
Hi [~elexx], 7.0.3 is "in vote" (should close this week), we don't have a plan
yet for 7.0.4 AFAIK.
> NPE in OpenEJBLifecycle when voting against beans
> -------------------------------------------------
>
> Key: TOMEE-2020
> URL: https://issues.apache.org/jira/browse/TOMEE-2020
> Project: TomEE
> Issue Type: Bug
> Affects Versions: 7.0.2
> Reporter: Alexander Falb
> Assignee: Romain Manni-Bucau
> Fix For: 7.0.4
>
> Attachments: openejb-trace.log
>
>
> We have some EJBs in our application which we disable during development by
> voting against them with a CDI extension.
> When we upgraded from JavaEE6 (OpenEJB 4.7.4) to JavaEE7 (OpenEJB 7.0.2) we
> encountered NullPointerExceptions in OpenEJBLifecycle:265 (see attached
> openejb-trace.log).
> Our EJBs look like this:
> {code}
> @javax.ejb.Startup
> @javax.ejb.Singleton
> @Exclude(ifProjectStage = {Development.UnitTest.class})
> public class MySingletonEJB { [...] }
> {code}
> The CDI extension just does some evaluation based on the parameters in
> {{@Exclude}} and calls {{processAnnotatedType.veto()}} like
> {code}
> vetoBeans(@Observes ProcessAnnotatedType pat) {
> if ([...]) pat.veto();
> }
> {code}
> I debugged OpenEJBLifecycle a bit and it looks like the beanManager does not
> "know" the bean (because it got vetoed), but OpenEJB assumes to get a bean
> reference from it. The NPE happens when calling {{bean.getScope()}}, because
> {{bean}} is null.
> {code}
> // OpenEJBLifecycle:263-265
> private void starts(final BeanManager beanManager, final Class<?> clazz) {
> final Bean<?> bean = beanManager.resolve(beanManager.getBeans(clazz));
> if (!beanManager.isNormalScope(bean.getScope())) {
> [...]
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)