jcricket / gwt-syncproxy

Provides Synchronous and Asynchronous access to GWT-RPC servlets from Java and Android
http://www.blueesoteric.com/open-source/gwt-syncproxy
Apache License 2.0
23 stars 14 forks source link

32kb + result payloads result in exception like NumberFormatException: For input string: "8].concat(" #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm seeing java.lang.NumberFormatException: For input string: "8].concat(" for 
really large returned payloads. Looking at GWT source code it seems that 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter will add in 
"].concat([ for returned arrays larger 32k. 

I've attached a patch that fixes this by parsing the concat array. 

java.lang.reflect.InvocationTargetException
    at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.savvion.webbpa.util.HeadlessServiceFactory$AsynchronousInvocationHandler$1.run(HeadlessServiceFactory.java:237)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
Caused by: com.google.gwt.user.client.rpc.InvocationException: Exception while 
invoking the remote service 
com.savvion.webbpa.common.client.services.CollaborationService.getProcessChanges
Since
    at com.gdevelop.gwt.syncrpc.RemoteServiceInvocationHandler.invoke(RemoteServiceInvocationHandler.java:215)
    at $Proxy13.getProcessChangesSince(Unknown Source)
    ... 7 more
Caused by: java.lang.NumberFormatException: For input string: "8].concat("
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:458)
    at java.lang.Integer.parseInt(Integer.java:499)
    at com.gdevelop.gwt.syncrpc.SyncClientSerializationStreamReader.readInt(SyncClientSerializationStreamReader.java:484)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.prepareToRead(AbstractSerializationStreamReader.java:38)
    at com.gdevelop.gwt.syncrpc.SyncClientSerializationStreamReader.prepareToRead(SyncClientSerializationStreamReader.java:377)
    at com.gdevelop.gwt.syncrpc.RemoteServiceSyncProxy.createStreamReader(RemoteServiceSyncProxy.java:111)
    at com.gdevelop.gwt.syncrpc.RemoteServiceSyncProxy.doInvoke(RemoteServiceSyncProxy.java:162)
    at com.gdevelop.gwt.syncrpc.RemoteServiceInvocationHandler.invoke(RemoteServiceInvocationHandler.java:180)
    ... 8 more

Original issue reported on code.google.com by cmacn...@gmail.com on 11 Oct 2010 at 10:24

Attachments:

GoogleCodeExporter commented 9 years ago
Additional patch for even larger serialized objects (I neglected to take into 
account "],[" concactentaion this should be applied on top of the previous patch

Original comment by cmacn...@gmail.com on 12 Oct 2010 at 6:51

Attachments:

GoogleCodeExporter commented 9 years ago
The patches contain quite many additional modifications (to help debugging). 
Just adding the "deconcat" method and invoking at the beginning of the parse 
method is sufficient.
But still thanks a lot for sharing it!

Original comment by hhcofc...@gmail.com on 17 Mar 2011 at 5:52

GoogleCodeExporter commented 9 years ago
I just ran into this issue, thanks for the patch

Original comment by your...@gmail.com on 22 Aug 2011 at 1:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r48.

Original comment by gwtdevel...@gmail.com on 23 Aug 2011 at 2:26