You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joseph Pachod <jp...@thomas-daily.de> on 2010/02/17 12:37:43 UTC
Guice & LazyInitProxyFactory : NPE when calling, first, public fields
hi
We're using Wicket with Guice.
An issue has just popped up : on some special injected objects, we
access public fields. These public fields are themselves injected
through guice.
However, due to the LazyInitProxyFactory, they're not. Indeed, as far as
I got it, the LazyInitProxyFactory waits for the first method call to do
the actual injection.
So, currently, when calling directly some members on guice injected bean
in wicket, I get a NPE.
I fear I've missed something obvious, but I don't find an easy way out...
Any suggestion ?
thanks in advance
--
Joseph Pachod
IT
THOMAS DAILY GmbH
Adlerstraße 19
79098 Freiburg
Deutschland
T + 49 761 3 85 59 310
F + 49 761 3 85 59 550
E joseph.pachod@thomas-daily.de
www.thomas-daily.de
Geschäftsführer/Managing Directors:
Wendy Thomas, Susanne Larbig
Handelsregister Freiburg i.Br., HRB 3947
Registrieren Sie sich unter www.signin.thomas-daily.de für die kostenfreien TD Morning News, eine Auswahl aktueller Themen des Tages morgens um 9:00 in Ihrer Mailbox.
Hinweis: Der Redaktionsschluss für unsere TD Morning News ist täglich um 8:30 Uhr. Es werden vorrangig Informationen berücksichtigt, die nach 16:00 Uhr des Vortages eingegangen sind. Die Email-Adresse unserer Redaktion lautet redaktion@thomas-daily.de.
To receive the free TD News International - a selection of the day's top issues delivered to your mail box every day - please register at www.signin.thomas-daily.de
Please note: Information received for our TD News International after 4 p.m. will be given priority for publication the following day. The daily editorial deadline is 8:30 a.m. You can reach our editorial staff at redaktion@thomas-daily.de.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Guice & LazyInitProxyFactory : NPE when calling, first, public
fields
Posted by Uwe Schäfer <sc...@thomas-daily.de>.
Uwe Schäfer schrieb:
> To me this does not feel like necessarily the right behaviour. I do not
> see a tremendous advantage in this resolving being done lazily.
for the record: we could change to doing it non-lazy, but it does not
solve this particular issue, as the value of public field is constant,
depending on the point in time where the CGLib-subclassing happened.
and as we cannot intercept field access...
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Guice & LazyInitProxyFactory : NPE when calling, first, public
fields
Posted by Uwe Schäfer <sc...@thomas-daily.de>.
Joseph Pachod schrieb:
> We're using Wicket with Guice.
> An issue has just popped up : on some special injected objects, we
> access public fields. These public fields are themselves injected
> through guice.
>
> However, due to the LazyInitProxyFactory, they're not. Indeed, as far as
> I got it, the LazyInitProxyFactory waits for the first method call to do
> the actual injection.
To me this does not feel like necessarily the right behaviour. I do not
see a tremendous advantage in this resolving being done lazily.
My suggestion would be to add a switch in some Settings object, that
controls this behaviour and inject as requested without deferrence.
As i don´t like the idea to live with a longterm patch of wickets, would
it be acceptable to include this kind of tweak into the wicket-guice
codebase if i provided an appropriate patch?
And if so, what would be the right place for such a switch?
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org