Serialization Exception after upgrading from gwt-sl-0.1.4e to gwt-sl-1.0

110 views
Skip to first unread message

Martin Hutchinson

unread,
Nov 2, 2009, 10:26:04 AM11/2/09
to gwt-sl
After upgrading from GWT 1.5 to GWT 1.7 we were having problems with
an upload form. Early investigation indicated that there was a
servlet configuration error in one of the gwtwidget classes. We have
upgraded to GWT SL 1.0 to see if this solves the problem, though I
don't yet know the answer as this has introduced a new problem earlier
in the workflow.

Getting the user information after authentication now fails with the
following exception:

Caused by: com.google.gwt.user.client.rpc.SerializationException: Type
'java.util.LinkedHashSet' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
custom field serializ
er. For security purposes, this type will not be serialized.
at
com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize
(LegacySerializationPolicy.java:140)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize
(ServerSerializationStreamWriter.java:591)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject
(AbstractSerializationStreamWriter.java:129)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue
(ServerSerializationStreamWriter.java:530)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass
(ServerSerializationStreamWriter.java:636)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl
(ServerSerializationStreamWriter.java:666)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize
(ServerSerializationStreamWriter.java:593)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject
(AbstractSerializationStreamWriter.java:129)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue
(ServerSerializationStreamWriter.java:530)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass
(ServerSerializationStreamWriter.java:636)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl
(ServerSerializationStreamWriter.java:666)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize
(ServerSerializationStreamWriter.java:593)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject
(AbstractSerializationStreamWriter.java:129)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue
(ServerSerializationStreamWriter.java:530)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:
573)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess
(RPC.java:441)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess
(RPC.java:384)
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall
(GWTRPCServiceExporter.java:72)
... 61 more


If I revert back to the old GWT SL library this serialization problem
goes away. Any idea why the newer version causes us to lose
LinkedHashSet serialization support?

George Georgovassilis

unread,
Nov 2, 2009, 11:38:49 AM11/2/09
to gwt-sl
Hello Martin,

most people report this error in the same scenario you are now finding
it, namely when upgrading GWT. Usually this is due by an incomplete
build step. You might want to enable debug logging for your webapp and
see, if GWT complains about not being able to find a serialization
file, which would be the root cause of that error.

GWT's RPC mechanism requires that classes wither implement
IsSerializable (note: Serializable won't do in this context) or
provide a serialization policy file. Could it be that your build
process rearranges the default directory structure of the GWT
compiler's output?

Martin Hutchinson

unread,
Nov 2, 2009, 12:49:52 PM11/2/09
to gwt-sl
George,

Thanks for the reply. I've enabled full debug logging but I can't see
the usual complaints about serialization in there. I've also double-
checked the directories to ensure that no files have been lost or
mangled.

The problem definitely occurs when upgrading between the GWT-SL
libraries. In my extracted war in the webapps directory of Tomcat I
can change the behaviour of the application by simply swapping the gwt-
sl lib:

When 0.1.4e is in WEB-INF/lib/ I can log into my application.

I then shut down Tomcat, swap this JAR for 1.0, then start Tomcat:

I can no longer log into my application -- the return result of the
authentication method blows up with the serialization error I posted
in my initial comment.

I then shut down Tomcat, delete the 1.0 JAR and replace it with the
0.1.4e JAR, then start Tomcat:

I can log into my application again.

Any ideas? I'd be happy to continue using the old version but this is
causing errors in my Continuous Integration tests (running on Jetty)
since the GWT upgrade. I can't confirm or deny whether these errors
still manifest in the 1.0 version until we can get over this
serialization hurdle.

Thanks for your time.


On Nov 2, 4:38 pm, George Georgovassilis <g.georgovassi...@gmail.com>
wrote:

Martin Hutchinson

unread,
Nov 2, 2009, 12:53:50 PM11/2/09
to gwt-sl

> Thanks for the reply.  I've enabled full debug logging but I can't see
> the usual complaints about serialization in there.

This sentence is *very* misleading. Let me elaborate.

I can still see the serialization error that I included in my initial
post. What I can't see are the errors you would usually get if you
lose or mangle the .gwt.rpc files in the build process.

Martin Hutchinson

unread,
Nov 2, 2009, 1:29:27 PM11/2/09
to gwt-sl
I've found a good reason that I'm having problems. The 1.0 release
was compiled with a 1.6 JDK. Our product targets 1.5 JREs. As such I
had to compile it myself. I naively assumed that the server/trunk
path in SVN would contain the latest working code. Further
investigation shows that this assumption is totally wrong.

I've checked out the 1.0 branch now and am about to start compiling...
hopefully this will work.
Reply all
Reply to author
Forward
0 new messages