Re: IncompatibleClassChangeError with ConcurrentMap

2011-06-07 Thread Stefan Christoph
Hi Sebastian,

I think I ran into the same issue like you have been described initially.
Switching to 2.1 Snapshot (2011-06-01) solved this issue for me.

Regarding you second issue - my code looks slightly different and provides
valid json representation back. Maybe this works for you as well.
Actually I'm not creating the JSONRepresentation by myself but just provide
pure Java Objects back. The JSON-serialization is then handled by restlet
itself. I'm using the Jackson-extension.
Code looks similar to:

@Get
public MyResponseClass get(){
   myResponseClass response = new MyREsponseClass();
   // some fany but unimportant stuff here ...
   setStatus(Status.SUCCESS_OK);
   return response;
}

If I call with accept=application/json, I get a Json response like expected.
Maybe that helps?

Cheers,

Stefan
On Tue, Jun 7, 2011 at 4:05 PM, Sebastian Wenninger <
sebastian.wennin...@gmail.com> wrote:

> I don't want to seem impatient, but this is a crucial part of my bachelor's
> thesis, so i don't have that much time to solve it.
> At least, can somebody else confirm that JsonRepresentations don't work
> properly so i can exclude an error for my part?
>
> Thanks,
> Sebastian
>
> --
> View this message in context:
> http://restlet-discuss.1400322.n2.nabble.com/IncompatibleClassChangeError-with-ConcurrentMap-tp6393712p6449749.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2759594
>

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2759609

Re: Help with GWT integration

2011-03-10 Thread Stefan Christoph
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 <
viniciusccarva...@gmail.com> 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