Swagatika
Swagatika

Reputation: 3436

GWT Deferred binding issue

I am running into an issue with GWT :

The exception stack looks like :

Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.cme.reg.fltrs.common.service.AnnouncementService' (did you forget to inherit a required module?)
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)
    at com.google.gwt.core.client.GWT.create(GWT.java:98)
    at com.cme.reg.fltrs.client.sharedui.utils.ServiceFactory.getAnnouncementService(ServiceFactory.java:117)
    at com.cme.reg.fltrs.client.announcement.AddMaintainAnnouncementModel.saveAnnouncement(AddMaintainAnnouncementModel.java:36)
    at com.cme.reg.fltrs.client.announcement.AddMaintainAnnouncementPanel.save(AddMaintainAnnouncementPanel.java:260)
    at com.cme.reg.fltrs.client.announcement.AddMaintainAnnouncementPanel$6.onClick(AddMaintainAnnouncementPanel.java:168)
    at com.cme.libs.gwt.client.widgets.events.CMEClickListener.onEvent(CMEClickListener.java:10)
    at com.cme.libs.gwt.client.widgets.events.CMEListenerCollection.fireEvent(CMEListenerCollection.java:51)
    at com.cme.libs.gwt.client.widgets.CMEButton$1.onClick(CMEButton.java:30)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127)

Its failing at : announcementService = GWT.create(AnnouncementService.class); Notes:

I have my service class : AnnouncementService @RemoteServiceRelativePath( "announcement.srvc" ) has been added to AnnouncementService.

Async service class: AnnouncementServiceAsync

Configurations.xml :

entry key="**/announcement.srvc" value-ref="announcementServiceServlet"

Any help, where I am doing wrong or missing anything ?

Upvotes: 0

Views: 3432

Answers (2)

emery
emery

Reputation: 9663

If you're getting a deferred binding error with your RPC, then in addition to checking there is a matching Async interface, another thing to check is to make sure that you have the same methods in the following 3 places:

  1. Synchronous interface
  2. Asynchronous interface
  3. Service implementation class

I got a similar "deferred binding" error when I accidentally had an extra method in my Synchronous (regular) interface that was missing in the Async interface and implementation class, but my IDE (IntelliJ IDEA 12) did not flag any files as having errors. When I finally remembered that I had recently removed a method from my service, I went into the Synchronous interface and saw that I had forgotten to remove that method's signature from the synchronous interface. Removing it so that the signatures matched in all three files fixed the Deferred binding error.

Upvotes: 0

Swagatika
Swagatika

Reputation: 3436

Thanks Thomas. Few The things to be checked:

1.Service must have a matching ServiceAsync class 2. Make sure all types used in Service implement IsSerializable

I was missing these two condition at few places.

Upvotes: 3

Related Questions