com.google.gwt.user.client.rpc.SerializationException?

8 views
Skip to first unread message

Tom

unread,
Dec 5, 2006, 1:30:45 AM12/5/06
to Google Web Toolkit
Helo, friends!
I am new to GWT, this is my first experience.
I am facing the following exception, you guys have any idea?

my RPC source code is the following hierarchy.
com.ajax.server.MyServiceImpl
com.ajax.client.MyService
com.ajax.client.MyServiceAsync
com.ajax.client.WebApp <= my entry point.

Inside MyServiceImpl, I do put serialversionUID.

Please give some guidance.

[WARN] Exception thrown into JavaScript
java.lang.RuntimeException: Checked exception thrown into JavaScript
(web mode behavior may differ)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:396)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeVoid(ModuleSpaceIE6.java:283)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:127)
at com.ajax.client.MyService_TypeSerializer.deserialize(transient
source for com.ajax.client.MyService_TypeSerializer:137)
at
com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:85)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:59)
at com.ajax.client.MyService_Proxy$1.onCompletionImpl(transient source
for com.ajax.client.MyService_Proxy:54)
at com.ajax.client.MyService_Proxy$1.onCompletionAndCatch(transient
source for com.ajax.client.MyService_Proxy:43)
at com.ajax.client.MyService_Proxy$1.onCompletion(transient source for
com.ajax.client.MyService_Proxy:37)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Caused by: com.google.gwt.user.client.rpc.SerializationException:
[Ljava.lang.String;/2364883620
at
com.ajax.client.MyService_TypeSerializer.raiseSerializationException(transient
source for com.ajax.client.MyService_TypeSerializer:134)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java:91)
at
com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java:117)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java:245)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java:155)
at
org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:117)
at
org.eclipse.swt.internal.ole.win32.IDispatch.Invoke(IDispatch.java:64)

Tom

unread,
Dec 5, 2006, 2:37:50 AM12/5/06
to Google Web Toolkit
Actually my code return a collection, which is ArrayList.
The list contains of String[].

public interface MyService extends RemoteService {
/*
* @gwt.typeArgs <java.lang.String[]>
*
*/
public ArrayList getData();
}

Do you have any idea how to annotate an array of String?

Thanks
Tom

Miguel Méndez

unread,
Dec 5, 2006, 7:50:25 AM12/5/06
to Google-We...@googlegroups.com
Hello Tom,

This one is subtle.  The gwt.typeArgs is a javadoc annotation.  However, you MyService interface declared the gwt.typeArgs inside of a regular comment.  The correct decl should be:


public interface MyService extends RemoteService    {
       /**
        * @gwt.typeArgs <java.lang.String[]>
        *
       */
       public ArrayList getData();
}

HTH,
Reply all
Reply to author
Forward
0 new messages