Saturday, February 18, 2012

Possible bug with ProxySerializerImpl

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".

In our application and in my test the issue occurs because we have an object that can have a reference to another object of the same class.  Here is a link to the test http://pastebin.com/NG1Xzw6h .  All of the tests pass except for "testGetAllProxySerializeDeserializeWithParentProxyObjectsSet".

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.

Here is a stack trace of the exception:

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)

--
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/-/_4mdhDfJ9B0J.
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate