So after seeing one of the Google I/O presentations on how to improve the performance of a GWT application I was trying to do something to pre-load some data into our jsp page to be read and loaded into our application using the GWT Dictionary. There was one set of objects that we use with RequestFactory proxy objects so I wanted to load them as proxy objects. I found that I could use RequestFactory.getSerializer with a String payload provided by the DefaultProxyStore but I encountered an issue when deserializing a list of objects that would have a reference to other objects in the list. The basic issue seems to be when calling ProxySerializer.deserialize(class,key) with the same key twice. The first time will work but doing it a second time causes an exception saying "The AutoBean has been frozen".
The workaround would be to serialize each object with one payload but that creates a bigger overall payload since there can be a lot of duplication.
Is this really a bug? Before I filed a bug I wanted to post the question here.
java.lang.IllegalStateException: The AutoBean has been frozen
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.checkFrozen(AbstractAutoBean.java:195)
at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.checkFrozen(ProxyAutoBean.java:196)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.setProperty(AbstractAutoBean.java:270)
at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.setProperty(ProxyAutoBean.java:253)
at com.google.web.bindery.autobean.vm.impl.BeanPropertyContext.set(BeanPropertyContext.java:44)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$3.visitValueProperty(AbstractRequestContext.java:910)
at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.traverseProperties(ProxyAutoBean.java:289)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.traverse(AbstractAutoBean.java:166)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.accept(AbstractAutoBean.java:101)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.processReturnOperation(AbstractRequestContext.java:879)
at com.google.web.bindery.requestfactory.shared.impl.ProxySerializerImpl.getProxyForReturnPayloadGraph(ProxySerializerImpl.java:167)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.getBeanForPayload(AbstractRequestContext.java:588)
at com.google.web.bindery.requestfactory.shared.impl.EntityCodex.decode(EntityCodex.java:101)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$3.visitReferenceProperty(AbstractRequestContext.java:889)
at com.google.web.bindery.autobean.vm.impl.ProxyAutoBean.traverseProperties(ProxyAutoBean.java:324)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.traverse(AbstractAutoBean.java:166)
at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.accept(AbstractAutoBean.java:101)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext.processReturnOperation(AbstractRequestContext.java:879)
at com.google.web.bindery.requestfactory.shared.impl.ProxySerializerImpl.getProxyForReturnPayloadGraph(ProxySerializerImpl.java:167)
at com.google.web.bindery.requestfactory.shared.impl.ProxySerializerImpl.doDeserialize(ProxySerializerImpl.java:184)
at com.google.web.bindery.requestfactory.shared.impl.ProxySerializerImpl.deserialize(ProxySerializerImpl.java:80)
at com.rodm.gwt.requestfactory.ProxySerializerBugTest.doProxySerializerTest(ProxySerializerBugTest.java:285)
at com.rodm.gwt.requestfactory.ProxySerializerBugTest.testGetAllProxySerializeDeserializeWithParentProxyObjectsSet(ProxySerializerBugTest.java:259)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)