After port to V3: revealInParent called four times

23 views
Skip to first unread message

Raphael André Bauer

unread,
Jun 15, 2010, 4:02:53 PM6/15/10
to gwt-pl...@googlegroups.com
Hi,


I had a working version of my app using V2 GWTP. After porting to V3
(current hg head) I observe a really strange behaviour.

I kept debugging, but I am a bit lost at that point now.

On the initial load of my app everything is fine. My App (a bit like
nestedexample) is set up, all presenters and views initialized. Gin
works, default place works. Cool.

However, when I navigate around, or call a certain place manually in
the browser URL the respective place is revealed four times
subsequently. When I debug I can clearly see that protected void
revealInParent() {..} is called exactly four times. This happens for
all my presenters right now.

It might be the case that something fundamentally went wrong when
eliminating my TokenFormatter calls and such, but the error even
happens, when I type my #Place manually in the browser what is imho
strange.


Any ideas why this "four-time-calling-of-presenters" might happen?

Sorry for the fuzzy description, but maybe anybody knows that behaviour.


Thanks!


Raphael

Raphael André Bauer

unread,
Jun 17, 2010, 4:11:59 PM6/17/10
to gwt-pl...@googlegroups.com
On Tue, Jun 15, 2010 at 10:02 PM, Raphael André Bauer
<raphael.a...@gmail.com> wrote:
> Hi,
>
>
> I had a working version of my app using V2 GWTP. After porting to V3
> (current hg head) I observe a really strange behaviour.
....

> However, when I navigate around, or call a certain place manually in
> the browser URL the respective place is revealed four times
> subsequently. When I debug I can clearly see that protected void
> revealInParent() {..} is called exactly four times. This happens for
> all my presenters right now.


I found the error. In V2 it is okay to bind everything as
inSingleton() scope. In V3 it seems I have to bind my basic stuff
asEagerSingleton().

bind(EventBus.class).to(DefaultEventBus.class).asEagerSingleton();
bind(PlaceManager.class).to(AppPlaceManager.class).asEagerSingleton();
bind(TokenFormatter.class).to(ParameterTokenFormatter.class).asEagerSingleton();
bind(RootPresenter.class).asEagerSingleton();
bind(ProxyFailureHandler.class).to(DefaultProxyFailureHandler.class).asEagerSingleton();

Maybe I missed that in the docs - if not this might be something for
the porting to V1 guide.

Cheers,

Raphael

Philippe Beaudoin

unread,
Jun 17, 2010, 4:19:33 PM6/17/10
to gwt-pl...@googlegroups.com
Strange.

I think you need the RootPresenter, and maybe the PlaceManager to be
eager singletons, but I wouldn't think the other are required.

Anyway, thanks for sharing. I will investigate this if I ever have the
time and am able to reproduce it.

PHilippe

On Thu, Jun 17, 2010 at 1:11 PM, Raphael André Bauer

Christian Goudreau

unread,
Jun 17, 2010, 4:33:18 PM6/17/10
to gwt-pl...@googlegroups.com
If I recall corectly, there's a bug in Gin where configure is called twice... maybe that have something to do with it.

Christian

Raphael André Bauer

unread,
Jun 18, 2010, 4:39:05 AM6/18/10
to gwt-pl...@googlegroups.com
On Thu, Jun 17, 2010 at 10:33 PM, Christian Goudreau
<goudreau....@gmail.com> wrote:
> If I recall corectly, there's a bug in Gin where configure is called
> twice... maybe that have something to do with it.
> Christian

okay. I am still using r137. So - that means that you two do not have
to bind your singletons "asEager"? Only me? Seems strange to me. So it
might be really a bug of GIN and has nothing to do with GTWP.

Thanks for your answers and clues,
If there is a anything I can do to to debug please help let me know...


Raphael

PhilBeaudoin

unread,
Jun 21, 2010, 2:59:27 AM6/21/10
to GWTP
I just tested it here on a couple of my apps running with the latest
version and gin-r137.jar and revealInParent() is called only once for
all the presenters I tried. Looking at my gin module I have:
bind(EventBus.class).to(DefaultEventBus.class).in(Singleton.class);
bind(PlaceManager.class).to(MyPlaceManager.class).in(Singleton.class);
bind(ProxyFailureHandler.class).to(FailureHandlerAlert.class).in(Singleton.class);
bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
bind(RootPresenter.class).asEagerSingleton();

In that order.

On Jun 18, 1:39 am, Raphael André Bauer
<raphael.andre.ba...@gmail.com> wrote:
> On Thu, Jun 17, 2010 at 10:33 PM, Christian Goudreau
>

Raphael André Bauer

unread,
Jul 14, 2010, 11:40:33 AM7/14/10
to gwt-pl...@googlegroups.com
On Mon, Jun 21, 2010 at 8:59 AM, PhilBeaudoin
<philippe...@gmail.com> wrote:
> I just tested it here on a couple of my apps running with the latest
> version and gin-r137.jar and revealInParent() is called only once for
> all the presenters I tried. Looking at my gin module I have:
> bind(EventBus.class).to(DefaultEventBus.class).in(Singleton.class);
> bind(PlaceManager.class).to(MyPlaceManager.class).in(Singleton.class);
> bind(ProxyFailureHandler.class).to(FailureHandlerAlert.class).in(Singleton.class);
> bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
> bind(RootPresenter.class).asEagerSingleton();

Yea! That works for me, too....

=> imho this "issue" arises when you update to V0.3 (current head)...
I think it would be great if you could mention that briefly in:
http://code.google.com/p/gwt-platform/wiki/PortingV1
(if you want, I can write three lines + a code snipplet..)


Thanks again!

Raphael

Philippe Beaudoin

unread,
Jul 14, 2010, 11:51:56 AM7/14/10
to gwt-pl...@googlegroups.com
Please go ahead and do it, I've made you a commiter.

Christian Goudreau

unread,
Jul 14, 2010, 11:56:04 AM7/14/10
to gwt-pl...@googlegroups.com
Just one clarification for that, it is not a bug, I was wrong, it's the expected behavior. (They to a check first, then do the real binding)

Christian
--
Christian Goudreau

Christian Goudreau

unread,
Jul 14, 2010, 11:57:16 AM7/14/10
to gwt-pl...@googlegroups.com
If I recall corectly, there's a bug in Gin where configure is called twice... maybe that have something to do with it.

I was talking about this. 
--
Christian Goudreau

Raphael André Bauer

unread,
Jul 14, 2010, 12:17:40 PM7/14/10
to gwt-pl...@googlegroups.com
On Wed, Jul 14, 2010 at 5:51 PM, Philippe Beaudoin
<philippe...@gmail.com> wrote:
> Please go ahead and do it, I've made you a commiter.
DONE... I hope it's okay...
Thanks,

Raphael

PhilBeaudoin

unread,
Jul 14, 2010, 12:40:17 PM7/14/10
to GWTP
Looks perfect! Thanks.

On Jul 14, 9:17 am, Raphael André Bauer
<raphael.andre.ba...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages