You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Matej <gm...@gmail.com> on 2016/05/27 22:38:34 UTC

Injection problems

Hi all.

Having some Injection NullPointerException problems.


1.)  I sometimes get an NPE when executing simple methods, where the
parameter is a Static class inside a nested static class. I know that
nested static classes can be problematic for proxies. Btu my problem is
that the NPE is not always present. From some Beans it happens from other
not. But not using static ineer classes fixes the poblem. Just wanted to
know, why the NPE is not alway present. Is it the length of the Injection
chain or Bean name length?



2.) I get an NPE when doing this:
 BeanHelper.getBeanManager().fireEvent(new MatchActualTrip(123));

It works in an simple exmaple. But in an production scenario with multple
EJBs it fails with NPE. Same if I add BeanManager with @Inject. The whole
chain is executed in an User Transcation, started from REST-CXF.

Thanks in advance for potential help.


Tested on Tomee 1.7.x.

Br

Matej

Re: Injection problems

Posted by Romain Manni-Bucau <rm...@gmail.com>.
A few yes but would need a sample to be sure.
Le 28 mai 2016 15:47, "Matej" <gm...@gmail.com> a écrit :

> Hi, Romain we are running 1.7.1 currently. Do you think 1.7.4 could help.
>
> Were there changes that could affect this you think?
>
> BR
>
> Matej
>
> 2016-05-28 11:40 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
>
> > Hi
> >
> > We would need more info but can be due to ejb resolving, context
> available
> > at that moment or other things.
> > Le 28 mai 2016 00:38, "Matej" <gm...@gmail.com> a écrit :
> >
> > > Hi all.
> > >
> > > Having some Injection NullPointerException problems.
> > >
> > >
> > > 1.)  I sometimes get an NPE when executing simple methods, where the
> > > parameter is a Static class inside a nested static class. I know that
> > > nested static classes can be problematic for proxies. Btu my problem is
> > > that the NPE is not always present. From some Beans it happens from
> other
> > > not. But not using static ineer classes fixes the poblem. Just wanted
> to
> > > know, why the NPE is not alway present. Is it the length of the
> Injection
> > > chain or Bean name length?
> > >
> > >
> > >
> > > 2.) I get an NPE when doing this:
> > >  BeanHelper.getBeanManager().fireEvent(new MatchActualTrip(123));
> > >
> > > It works in an simple exmaple. But in an production scenario with
> multple
> > > EJBs it fails with NPE. Same if I add BeanManager with @Inject. The
> whole
> > > chain is executed in an User Transcation, started from REST-CXF.
> > >
> > > Thanks in advance for potential help.
> > >
> > >
> > > Tested on Tomee 1.7.x.
> > >
> > > Br
> > >
> > > Matej
> > >
> >
>

Re: Injection problems

Posted by Matej <gm...@gmail.com>.
Hi, Romain we are running 1.7.1 currently. Do you think 1.7.4 could help.

Were there changes that could affect this you think?

BR

Matej

2016-05-28 11:40 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:

> Hi
>
> We would need more info but can be due to ejb resolving, context available
> at that moment or other things.
> Le 28 mai 2016 00:38, "Matej" <gm...@gmail.com> a écrit :
>
> > Hi all.
> >
> > Having some Injection NullPointerException problems.
> >
> >
> > 1.)  I sometimes get an NPE when executing simple methods, where the
> > parameter is a Static class inside a nested static class. I know that
> > nested static classes can be problematic for proxies. Btu my problem is
> > that the NPE is not always present. From some Beans it happens from other
> > not. But not using static ineer classes fixes the poblem. Just wanted to
> > know, why the NPE is not alway present. Is it the length of the Injection
> > chain or Bean name length?
> >
> >
> >
> > 2.) I get an NPE when doing this:
> >  BeanHelper.getBeanManager().fireEvent(new MatchActualTrip(123));
> >
> > It works in an simple exmaple. But in an production scenario with multple
> > EJBs it fails with NPE. Same if I add BeanManager with @Inject. The whole
> > chain is executed in an User Transcation, started from REST-CXF.
> >
> > Thanks in advance for potential help.
> >
> >
> > Tested on Tomee 1.7.x.
> >
> > Br
> >
> > Matej
> >
>

Re: Injection problems

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

We would need more info but can be due to ejb resolving, context available
at that moment or other things.
Le 28 mai 2016 00:38, "Matej" <gm...@gmail.com> a écrit :

> Hi all.
>
> Having some Injection NullPointerException problems.
>
>
> 1.)  I sometimes get an NPE when executing simple methods, where the
> parameter is a Static class inside a nested static class. I know that
> nested static classes can be problematic for proxies. Btu my problem is
> that the NPE is not always present. From some Beans it happens from other
> not. But not using static ineer classes fixes the poblem. Just wanted to
> know, why the NPE is not alway present. Is it the length of the Injection
> chain or Bean name length?
>
>
>
> 2.) I get an NPE when doing this:
>  BeanHelper.getBeanManager().fireEvent(new MatchActualTrip(123));
>
> It works in an simple exmaple. But in an production scenario with multple
> EJBs it fails with NPE. Same if I add BeanManager with @Inject. The whole
> chain is executed in an User Transcation, started from REST-CXF.
>
> Thanks in advance for potential help.
>
>
> Tested on Tomee 1.7.x.
>
> Br
>
> Matej
>