Monday, October 31, 2011

Re: SerializationException with List

Your problem should be either that the list itself is a problem, or one or more of the elements inside it is a problem.

The list itself can be non-serializable if your RPC interfaces do not indicate that this list implementation will be required. You can check by looking first in your *.gwt.rpc file that's created from your compile to see whether your list implementation is present. If it's not, then the problem is with your list implementation and not (necessarily) the things you put in the list.

Your compile should also generate a *.rpc.log file where GWT shows you what it worked out about the serializability of each type.

If your list implementation is in the gwt.rpc file, then the problem should be with whatever you're putting into the list.

Remember that gwt-serializability is more than just whether you implement Serializable. There are other constraints too, most notably that you need a no-arg constructor and that all your non-static non-final fields must also be gwt-serializable (unless you provide a CustomFieldSerializer).

HTH
Paul

On 29/10/11 16:00, darkling wrote:
> Just an addendum but I tried removing maven and running the eclipse
> gwt plugin directly to build my project. I got the exact same errors:
> "The response can not be deserialized" when I have gwt-servlet-2.2.jar
> in my war lib and "The response can not be deserialized expected
> version 7 but server had 5" when I don't.
>
> Any help would be wonderful because we're trying to do a release come
> Monday
> Thanks
>
> On Oct 28, 7:52 pm, darkling<darkling...@aol.com> wrote:
>> Yes but I still got The response could not be deserialized
>>
>> Im using maven plugin so my POM looks like this:
>>
>> <plugins>
>> <plugin>
>> <groupId>org.codehaus.mojo</groupId>
>> <artifactId>gwt-maven-plugin</artifactId>
>> <version>2.4.0</version>
>> <configuration>
>> <localWorkers>1</localWorkers>
>> <warSourceDirectory>${basedir}/war</warSourceDirectory>
>> <module>${cura.assessor.module}</module>
>> <style>OBFUSCATED</style>
>> <gwtVersion>2.4.0</gwtVersion>
>> <disableCastChecking>true</disableCastChecking>
>> <soyc>false</soyc>
>> </configuration>
>> <executions>
>> <execution>
>> <goals>
>> <goal>compile</goal>
>> <goal>generateAsync</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>>
>> I'm not manually including any gwt jars, though I added gwt-
>> servlet.jar to my war folder because I got the explicit mismatching
>> version error when I didn't
>> Matt
>>
>> On Oct 28, 4:18 pm, Markus Zywitza<markus.zywi...@gmail.com> wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Did you already try ArrayList instead of List?
>>> --Markus
>>> 2011/10/28 darkling<darkling...@aol.com>
>>>> I've just managed to update my GWT (2.4) and I'm having problems with
>>>> my RPCs. Every time I try to send a List object it says the item can
>>>> not be deserialized. I single stepped through it and it comes out as a
>>>> SerializationException which GWT wraps in a
>>>> IncompatibleRemoteServiceException.
>>>> The Lists are of pojo objects that do implement Serializable and have
>>>> always been deserializable before. I thought that it might be related
>>>> to mismatching GWT jars so I tried changing them. When I use the gwt-
>>>> servlet.jar (version 2.2.) it says
>>>> "Response can not be deserialized".
>>>> When I use a different version of that jar it says "
>>>> Response can not be deserialized expected version 7 but server had 5"
>>>> or something like that which leads me to believe my jars are correct.
>>>> But for some reason I can't deserialize a list. I've seen a lot of
>>>> postings on this subject but no concrete answers. I'm not running in
>>>> hosted mode, just using raw tomcat. I can't figure out what's wrong.
>>>> Can anyone recommend some other things I should check? Or a way to
>>>> debug so I know what versions are being used? The System no longer
>>>> complains about the versions when I use the "correct" jars but if the
>>>> versions are correct can anyone suggest a reason why the List object
>>>> can not be deserialized?
>>>> Any help would be great, thanks.
>>>> --
>>>> You received this message because you are subscribed to the Google Groups
>>>> "Google Web Toolkit" group.
>>>> To post to this group, send email to google-web-toolkit@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> google-web-toolkit+unsubscribe@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment