i found da problem... forgot to call the bindHandler method to register the handler :)
On Jun 12, 7:51 pm, "I~N~S~I" <[email protected]> wrote: > Hi All, > > I'm trying to create a MVP model of GWT Sample app. as soon as the > execute method is called in the dispatcher below error gets logged. > > net.customware.gwt.dispatch.shared.UnsupportedActionException: No > handler is registered for com.project.jobbank.shared.rpc.SendQuery > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown > Source) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown > Source) > at java.lang.reflect.Constructor.newInstance(Unknown Source) > at > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105) > at > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) > at > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav a: > 157) > at > com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForRetur > n(BrowserChannel.java: > 1713) > at > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann > elServer.java: > 165) > at > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java: > 120) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java: > 507) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java: > 264) > at > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j > ava: > 91) > at > net.customware.gwt.dispatch.shared.UnsupportedActionException_FieldSerializ > er.instantiate(UnsupportedActionException_FieldSerializer.java) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) > at > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) > at > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav a: > 157) > at > com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForRetur > n(BrowserChannel.java: > 1713) > at > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann > elServer.java: > 165) > at > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java: > 120) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java: > 507) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java: > 264) > at > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j > ava: > 91) > at com.google.gwt.user.client.rpc.impl.SerializerBase$MethodMap > $.instantiate$(SerializerBase.java) > at > com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBa > se.java: > 140) > at > com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deseria > lize(ClientSerializationStreamReader.java: > 114) > at > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readO > bject(AbstractSerializationStreamReader.java: > 61) > at > com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceiv > ed(RequestCallbackAdapter.java: > 199) > at > com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java: > 287) > at com.google.gwt.http.client.RequestBuilder > $1.onReadyStateChange(RequestBuilder.java:393) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) > at > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) > at > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav a: > 157) > at > com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForRetur > n(BrowserChannel.java: > 1713) > at > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChann > elServer.java: > 165) > at > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java: > 120) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java: > 507) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java: > 264) > at > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.j > ava: > 91) > at com.google.gwt.core.client.impl.Impl.apply(Impl.java) > at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188) > at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) > at > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) > at > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.jav a: > 157) > at > com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java : > 1668) > at > com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChan > nelServer.java: > 401) > at > com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java : > 222) > at java.lang.Thread.run(Unknown Source) > > *************************************************************************** > *************************************************************************** > ***************************************** > below are the Presenter , action, actionhander and result classes. > > public class HomePagePresenter extends > WidgetPresenter<HomePagePresenter.Display>{ > > private static final String SERVER_ERROR = "An error occured > while " > +"attempting to connect to the server"; > > public interface Display extends WidgetDisplay{ > public HasValue<String> getQuery(); > > public HasClickHandlers getSearch(); > } > > public static final Place PLACE = new Place("Home"); > private final DispatchAsync dispatcher; > �...@suppresswarnings("unused") > private final SearchResponseDialogPresenter > searchResponseDialogPresenter; > > �...@inject > public HomePagePresenter(final Display display, > final EventBus eventBus, > final DispatchAsync dispatcher, > final SearchResponseDialogPresenter > searchResponseDialogPresenter) > { > super(display, eventBus); > // TODO Auto-generated constructor stub > this.dispatcher = dispatcher; > this.searchResponseDialogPresenter = > searchResponseDialogPresenter; > > bind(); > } > > �...@override > public Place getPlace() { > // TODO Auto-generated method stub > return PLACE; > } > > �...@override > protected void onBind() { > display.getSearch().addClickHandler(new ClickHandler() > { > > public void onClick(final ClickEvent event) { > doSearch(); > > } > }); > > } > > protected void doSearch() { > Log.info("Calling doSearch"); > dispatcher.execute(new > SendQuery(display.getQuery().getValue()), > new > DisplayCallback<SendQueryResult>(display) { > > �...@override > protected void > handleFailure(Throwable e) { > Log.error("Handle > Faliour: ",e); > > Window.alert(SERVER_ERROR); > } > > �...@override > protected void > handleSuccess(SendQueryResult value) { > eventBus.fireEvent(new > QuerySentEvent(value.getQuery(), > value.getMessage())); > } > }); > > } > > �...@override > protected void onPlaceRequest(PlaceRequest request) { > final String query = request.getParameter("q", null); > > if(query != null){ > display.getQuery().setValue(query); > } > > } > > �...@override > protected void onUnbind() { > // TODO Auto-generated method stub > > } > > public void refreshDisplay() { > // TODO Auto-generated method stub > > } > > public void revealDisplay() { > // TODO Auto-generated method stub > > } > > } > > *************************************************************************** > *************************************************************************** > **************************************** > public class SendQuery implements Action<SendQueryResult>{ > > /** > * > */ > private static final long serialVersionUID = > -4544779145020863564L; > > private String query; > > �...@suppresswarnings("unused") > private SendQuery(){ > } > > public SendQuery(final String query){ > this.query = query; > } > > public String getQuery() { > return query; > } > > } > > *************************************************************************** > *************************************************************************** > *********************************************** > public class SendQueryHandler implements ActionHandler<SendQuery, > SendQueryResult>{ > > private final Log logger; > private final Provider<ServletContext> servletContext; > �...@suppresswarnings("unused") > private final Provider<HttpServletRequest> servletRequest; > > �...@inject > public SendQueryHandler(final Log logger, > final Provider<ServletContext> servletContext, > final Provider<HttpServletRequest> > servletRequest){ > this.logger = logger; > this.servletContext = servletContext; > this.servletRequest = servletRequest; > } > > public SendQueryResult execute(final SendQuery action, > final ExecutionContext context) > throws ActionException { > final String query = action.getQuery(); > > try{ > String serverInfo = > servletContext.get().getServerInfo(); > > final String message = "Query: "+query+"\n" > +"server Info: "+serverInfo; > > return new SendQueryResult(query,message); > > }catch(Exception caught){ > logger.error("Unable to send message", caught); > throw new ActionException(caught); > } > } > > public Class<SendQuery> getActionType() { > // TODO Auto-generated method stub > return SendQuery.class; > } > > public void rollback(SendQuery arg0, SendQueryResult arg1, > ExecutionContext arg2) throws ActionException { > // TODO Auto-generated method stub > > } > > } > > *************************************************************************** > *************************************************************************** > ************************************** > public class SendQueryResult implements Result{ > > /** > * > */ > private static final long serialVersionUID = > 6664713784753210379L; > > private String query; > private String message; > > public SendQueryResult(final String query, final String message) > { > this.query = query; > this.message = message; > } > > �...@suppresswarnings("unused") > private SendQueryResult(){ > } > > public String getQuery(){ > return query; > } > > public String getMessage(){ > return message; > } > > } > > Any help on this would be much appreciated... > > Thnkx in advance. > > InsI -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
