Hi, I was experiencing a similar issue. Problem manifested itself in the fact that the client was requesting the data object to be represented as application/x-java-serialized-object+gwt while my rest service always provided a JSON representation. In my case this yield to a similar stack trace like you are reporting. Root cause in my case was that I marked the DataObject which is commonly used between GWT client and server(in this case the Rest service) was marked with is the com.google.gwt.user.client.rpc.IsSerializable interface and not the java.io.Serializable interface. This used to work fine with GWT RPC mechanism but didn't work for using the restlet stack. Changing to Serializable solved the issue for me.
Cheers, Stefan On Thu, Mar 10, 2011 at 10:32 AM, Vinicius Carvalho < [email protected]> wrote: > Hi! I'm trying to replace the GWT RPC by pure rest services. > > I'm following the examples at ( > http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html) > with > one difference, our services already exist and we use resteasy to expose > them. > > When I invoke the service I'm getting an exception: > > java.io.IOException: Can't parse the enclosed entity > at > com.furiousbob.client.services.NodeServiceProxyProxy$1.handle(NodeServiceProxyProxy.java:47) > at > org.restlet.client.engine.adapter.ClientAdapter$1.handle(ClientAdapter.java:93) > at > org.restlet.client.engine.adapter.GwtClientCall$2.onResponseReceived(GwtClientCall.java:245) > at > com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) > at > com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) > at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > 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.java:157) > at > com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) > at > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) > at > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) > at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) > at > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) > at > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) > at com.google.gwt.core.client.impl.Impl.apply(Impl.java) > at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) > at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > 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.java:157) > at > com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) > at > com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) > at > com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) > at java.lang.Thread.run(Thread.java:619) > > I've tried to change my services from json to xml, but I keep getting the > same exception. > I'm using restlet 2.1m2 for GWT 2.1.0 > > I don't have access to the generated proxy class, so I could not debug > further. > > Any ideas? > > -- > The intuitive mind is a sacred gift and the > rational mind is a faithful servant. We have > created a society that honors the servant and > has forgotten the gift. > > ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2710627

