openwebbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Bergmark <bergm...@apache.org>
Subject Re: Only no-args constructor executed
Date Fri, 12 Sep 2014 14:52:21 GMT
It may also be worth mentioning that at injection time for normal scoped
beans we only inject a client proxy.  It may be the construction of the
proxy class that is hitting your no-args constructor.

Once you invoke a method on that proxy, I would expect the @Inject
constructor to be called when the proxy obtains an instance form the
context.

On Fri, Sep 12, 2014 at 10:24 AM, Romain Manni-Bucau <rmannibucau@gmail.com>
wrote:

> Hi
>
> did you test against 1.7? code was totally rewritten
>
>
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
> 2014-09-12 15:56 GMT+02:00 Martin Strohal <martin.strohal@1und1.de>:
> > Hi,
> >
> > I have a question about ApplicationScoped CDI beans with constructor
> > injection.
> > My bean has two constructors: one default without parameters and one
> > with @Inject.
> > If I inject this bean in another one, only the default constructor is
> > executed (I've put some logging messages in both constructors). The
> > injection constructor is not executed, so the field is null.
> > How can that be? What am I doing wrong?
> >
> > (BTW: I'm using openwebbeans 1.1.8 in TomEE 1.5.2)
> >
> > Thanks,
> > Martin
>

Mime
View raw message