Error in deserializing an instance of a user-defined class extending ArrayList as a field of another user-defined class

2 views
Skip to first unread message

Denis Treskunov

unread,
Jun 20, 2006, 4:11:46 PM6/20/06
to Google Web Toolkit
I'm having a problem with client-to-server deserialization. (Other
direction works fine, strangely enough.) Below is a condensed version
of the code.
Observations:
1. When Page.ROIs == null, testPage works.
2. When Page.ROIs != null, testPage raises a
java.lang.IllegalArgumentException. Stack trace is at the end of this
message.
3. testROIs works with the same RegionOfInterestList object as the one
in ROIs field of Page.

I've spent a lot of time on this problem, and any help/hints will be
appreciated.

Thanks.

class Page implements IsSerializable {
private RegionOfInterestList ROIs;

...
}

class RegionOfInterestList extends ArrayList implements IsSerializable
{
...
}

class PageServiceImpl extends RemoteServiceServlet {
public void testPage(Page p);
public void testROIs(RegionOfInterestList ROIs);
}

12:47:42,111 ERROR [/daen-gref]:675 - Exception while dispatching
incoming RPC call
java.lang.IllegalArgumentException
at
sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:656)
at
com.google.gwt.user.server.rpc.ServerSerializationStream.deserializeClass(ServerSerializationStream.java:470)
at
com.google.gwt.user.server.rpc.ServerSerializationStream.deserialize(ServerSerializationStream.java:519)
at
com.google.gwt.user.server.rpc.ServerSerializationStream.readObject(ServerSerializationStream.java:443)
at
com.google.gwt.user.server.rpc.ServerSerializationStream.deserializeValue(ServerSerializationStream.java:411)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:290)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:186)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Message has been deleted

BAKUL

unread,
Jun 20, 2006, 5:44:57 PM6/20/06
to Google Web Toolkit
All i can say that IsSerializable needs to be implemented for the
result set returning to client from Server. If you are sending
something from Client to Server, it needs to implement Serializable and

not IsSerializable.

Best of luck.


Bakul Brahmbhatt

Denis Treskunov

unread,
Jun 21, 2006, 3:05:32 PM6/21/06
to Google Web Toolkit
Thanks for the reply. I actually worked around this problem by having
RegionOfIterest class contain an ArrayList instead of inheriting from
it. Now it serializes and de-serializes just fine both ways.

Miguel Méndez

unread,
Jun 26, 2006, 8:30:03 AM6/26/06
to Google-We...@googlegroups.com
Denis,

Which version of GWT are you using?  There was a bug with version 1.0.20 that would have prevented this from working correctly.

Thanks,

--
Miguel
Reply all
Reply to author
Forward
0 new messages