PlaceController constructor Deprecated

618 views
Skip to first unread message

Fabricio Pizzichillo

unread,
Sep 9, 2011, 8:16:17 AM9/9/11
to google-we...@googlegroups.com
Hello friends.
I use GIN to implement dependency injection.
I upgraded to version 2.4.0 and I encounter a problem when I "bind (EventBus.class).To (SimpleEventBus.class). In (Singleton.class);"
The log says "Deferred binding result type 'com.google.gwt.event.shared.EventBus' should not be abstract"
This happens when I change the imported packages of "importcom.google.gwt.event.shared.EventBus;
com.google.gwt.event.shared.SimpleEventBus import, "to" importcom.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.event.shared.SimpleEventBus;. "
I made this change because the constructor of the class "PlaceController" is deprecated
"@ Deprecated
   public PlaceController (com.google.gwt.event.shared.EventBus eventBus) {
     this ((EventBus) eventBus);
   } "

Any idea how to solve it?

Thanks and greetings!

Thomas Broyer

unread,
Sep 9, 2011, 10:01:37 AM9/9/11
to google-we...@googlegroups.com
There must be somewhere in your code where you have a dependency on com.google.gwt.event.shared.EventBus rather than com.google.web.bindery.event.shared.EventBus.

What happens is: in the absence of a binding, GIN will use a GWT.create() (contrary to Guice which will fail to build the injector), and com.google.gwt.event.shared.EventBus has no deferred-binding rule (<replace-with> or <generate-with>) so GWT tries to instantiate it with its zero-arg constructor; but EventBus is abstract, so GWT complains.

Fabricio Pizzichillo

unread,
Sep 9, 2011, 10:06:03 AM9/9/11
to google-we...@googlegroups.com
HI Thomas.
Thanks for the quick response. I'll check the code and see if I have any error.

regards


2011/9/9 Thomas Broyer <t.br...@gmail.com>
There must be somewhere in your code where you have a dependency on com.google.gwt.event.shared.EventBus rather than com.google.web.bindery.event.shared.EventBus.

What happens is: in the absence of a binding, GIN will use a GWT.create() (contrary to Guice which will fail to build the injector), and com.google.gwt.event.shared.EventBus has no deferred-binding rule (<replace-with> or <generate-with>) so GWT tries to instantiate it with its zero-arg constructor; but EventBus is abstract, so GWT complains.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/NSCn-c07g1wJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Fabricio Pizzichillo

unread,
Sep 9, 2011, 11:31:37 AM9/9/11
to google-we...@googlegroups.com
HI Thomas.
In my code, I have a class that extends AbstractActivity.
The problem is that the interface Activity, which has the method "void start (AcceptsOneWidget panel, EventBus eventBus)." EventBus belongs to the package"com.google.gwt.event.shared" and should be the "com.google.web.bindery.event.shared"
Is this a mistake?

regards

2011/9/9 Fabricio Pizzichillo <fpizzi...@gmail.com>

Thomas Broyer

unread,
Sep 9, 2011, 11:55:45 AM9/9/11
to google-we...@googlegroups.com
Maybe [1], but that's not relevant to your issue: start() is not called by GIN but by an ActivityManager. That one has a dependency on some EventBus, but the web.bindery one, so it's not the guilty party either.

[1] Changing the type of the argument from the com.google.gwt.… EventBus to its parent in web.bindery would have broken everyone's activities, because Java only supports covariance for return types (see http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)#Java )
Reply all
Reply to author
Forward
0 new messages