3

I'm in development with a gwt/app engine application and a problem has appeared since upgrading to App Engine 1.6.4/GWT 2.4.0. I use Java for app engine. I am seeing serialization problems. I'm not sure if the upgrade caused this problem -- it broke my app and I had to recreate the Eclipse project.

I'm using GWT XsrfToken with GWT RPC. It works fine in Eclipse in development mode, but when I deploy my application to app engine, I get the following exception in the app engine log:

javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type 'com.google.gwt.user.client.rpc.XsrfToken' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = com.google.gwt.user.client.rpc.XsrfToken@1e80c87
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:619)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:539)
    at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:616)
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:474)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:571)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
...more 

Any help would be very appreciated.

4
  • I'm following the instructions on developers.google.com/web-toolkit/doc/latest/… and everything works fine with GWT2.4. Are you sure you're using the correct XsrfToken (it should be located inside the jar gwt-servlet-2.4.0.jar)?? It implements the interface RpcToken, which in turn extends java.io.Serializable, so you shouldn't get this error.
    – Renato
    Apr 3, 2012 at 23:12
  • @renato thanks for your reply. I think I have things set up right. In Eclipse, if I ctl-shift-T and type in XsrfToken, it shows it in gwt-user.jar, but I assume that's only used in Eclipse? I have gwt-servlet.jar from gwt 2.4 in my war/WEB-INF/lib folder. One thing I notice is that in the Java Build Path/Order & Export, gwt-servlet.jar (and other JARs that are automatically added by the google plugin) are not shown -- only the app engine and gwt sdk. Question: have you deployed with gwt 2.4 and app engine 1.6.4, or only run on Eclipse? Because it works in dev mode, just not when i deploy.
    – ptflix
    Apr 4, 2012 at 1:22
  • I deploy with different servers (Jetty and Tomcat) and it always works. The fact that it works for you in Dev mode but not in deployment suggests that you're using some JAR from the Dev server which maybe is not present, or is not the same, in the deployment server. If I were you, I would try to play a little bit with the jars, remove gwt-users.jar from the lib folder, or add gwt-servlet there if it's not yet there.... and so on.
    – Renato
    Apr 4, 2012 at 7:06
  • @renato I built a little test app using XSRF tokens and deployed it. It works fine. I'm suspecting that I need to recreate all my dependent projects to make this work. The Order & Export panel in Eclipse build config looks the same in both my project that doesn't work and my test project that does work. I'll report back when I'm done with recreating my dependent projects and retest.
    – ptflix
    Apr 4, 2012 at 15:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.