class suddenly no longer serializable

93 views
Skip to first unread message

Dennis Haupt

unread,
Aug 8, 2011, 11:20:19 AM8/8/11
to google-we...@googlegroups.com
the gwt compiler really needs an option to make it spill out why a class isn't serializable. i have one which i have used for weeks without a change, and suddenly, i get this error:
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type 'whatever' was not included in the set of types which can be deserialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be deserialized.
at com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.instantiate(IncompatibleRemoteServiceException_FieldSerializer.java:16)
at com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException_FieldSerializer.create(IncompatibleRemoteServiceException_FieldSerializer.java:25)
at com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBase.java:115)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:111)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:216)
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.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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:167)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)

no change has been made at the class or at any configuration xml. i did the "did i pull the plug"-checks, there's nothing wrong. what should i check next?

Jeff Larsen

unread,
Aug 8, 2011, 11:22:55 AM8/8/11
to google-we...@googlegroups.com
Does your class contain a Collection where you could be putting an object that is not serializable? 

Dennis Haupt

unread,
Aug 8, 2011, 11:32:56 AM8/8/11
to google-we...@googlegroups.com
the error message explicitly states that class x is not in the deserializationwhitelist.
i've experiences this before with another class (a simple enum, not fields at all)

2011/8/8 Jeff Larsen <lars...@gmail.com>
Does your class contain a Collection where you could be putting an object that is not serializable? 

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

Juan Pablo Gardella

unread,
Aug 8, 2011, 11:48:02 AM8/8/11
to google-we...@googlegroups.com
When I suddenly have this error is when have:

1) Cache some .js in the browser. Clean the cache and fix.
2) I have different versions of compiled classes in client side and server side. I sometimes put in webapp folder the .js files to run in tomcat inside eclipse and the forgot remove the folder. So when I make the war file it have older .js files.

Juan

2011/8/8 Dennis Haupt <d.ha...@googlemail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

Dennis Haupt

unread,
Aug 8, 2011, 11:48:45 AM8/8/11
to google-we...@googlegroups.com
in the rpc-files that class is configured as "true true false false". does that make sense? what could cause this?

2011/8/8 Dennis Haupt <d.ha...@googlemail.com>

Dennis Haupt

unread,
Aug 8, 2011, 12:08:11 PM8/8/11
to google-we...@googlegroups.com
i just deleted and recompiled everything. still the same error. in one of my rpc-files, the class is "true true true true", in all others its "true true false false". changing it manually does help in hosted mode. wtf is this?

Dennis Haupt

unread,
Aug 8, 2011, 12:26:03 PM8/8/11
to google-we...@googlegroups.com
my solution:

/**
* do not delete this method. the gwt compiler refuses to enable deserialization of "ViewableKey" on client side
* because of its generic parameter, even if it's only used with serializable ones. i don't know why it worked before.
*/
void hackToMakeTheGWTCompilerPutViewableKeyIntoTheWhiteList(final ViewableKey<String> key,
final AsyncCallback<Void> async);


2011/8/8 Dennis Haupt <d.ha...@googlemail.com>
Reply all
Reply to author
Forward
0 new messages