tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Falb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TOMEE-2020) NPE in OpenEJBLifecycle when voting against beans
Date Fri, 10 Mar 2017 07:58:04 GMT

    [ https://issues.apache.org/jira/browse/TOMEE-2020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15904657#comment-15904657
] 

Alexander Falb commented on TOMEE-2020:
---------------------------------------

Hello,

is there an ETA for 7.0.4? I just found "no release date" on the roadmap.

Regards,
Alex 

> 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)

Mime
View raw message