RequestFactory Could not parse payload: payload[0] = N

606 views
Skip to first unread message

Sydney

unread,
Jul 28, 2012, 3:46:00 PM7/28/12
to google-we...@googlegroups.com

After deploying my app on appengine, I get the following exception:

com.google.web.bindery.requestfactory.server.RequestFactoryServlet doPost: Unexpected error
java.lang.RuntimeException: Could not parse payload: payload[0] = N
    at com.google.web.bindery.autobean.vm.impl.JsonSplittable.create(JsonSplittable.java:70)
    at com.google.web.bindery.autobean.shared.impl.StringQuoter.create(StringQuoter.java:46)
    at com.google.web.bindery.autobean.shared.ValueCodex$Type$7.encode(ValueCodex.java:122)
    at com.google.web.bindery.autobean.shared.ValueCodex.encode(ValueCodex.java:315)
    at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl$ValueCoder.extractSplittable(AutoBeanCodexImpl.java:500)
    at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.setProperty(AbstractAutoBean.java:277)
    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.server.Resolver$PropertyResolver.visitValueProperty(Resolver.java:154)
    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.server.Resolver.resolveClientValue(Resolver.java:395)
    at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.processInvocationMessages(SimpleRequestProcessor.java:483)
    at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:225)
    at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:127)
    at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

Any idea of what the exception means? Thanks

Nick Siderakis

unread,
Jan 14, 2013, 11:17:27 AM1/14/13
to google-we...@googlegroups.com
Hey Sydney, I've been seeing the same error message recently. Did you figure it out?

El Mentecato Mayor

unread,
Jan 16, 2013, 1:08:44 PM1/16/13
to google-we...@googlegroups.com
Just saw this error myself as well, slightly different message:

Unexpected error: java.lang.RuntimeException: Could not parse payload: payload[0] = I

using GWT 2.5 and no GAE. Stacktrace is exactly the same though. Don't know why or what it means, just that I get it so far when a specific request is made. Has anybody found out what this means?

Thomas Broyer

unread,
Jan 16, 2013, 1:47:11 PM1/16/13
to google-we...@googlegroups.com
Would be great if any of you could log the request payload when this error happens.
In the mean time, we might want to modify the RequestFactoryServlet to log the payload when there's an unrecoverable error, in addition to the exception.
Could you please open an issue? (if there's none already)

El Mentecato Mayor

unread,
Jan 18, 2013, 3:23:52 PM1/18/13
to google-we...@googlegroups.com
I should have thought of that, sorry. Unfortunately (fortunately for me), I don't see the error anymore. Lots of things changed in the mean time (source code and db schema) as this project is under heavy development. Yes, I could go back-trace using my repository and maybe make it fail again, but time is a scarce commodity, so I choose to continue development.

I did notice one anomaly the day it happened, not sure it's related to the issue; I had a copy of a src directory under my WEB-INF folder, (I blame eclipse, but who knows, could have been user-error; me), which I deleted. I'll make sure to capture the payload if I see this again.

Sydney

unread,
Feb 6, 2013, 5:07:19 PM2/6/13
to google-we...@googlegroups.com
If you have a test case to reproduce that issue, you can provide it to that issue on google app engine: https://code.google.com/p/googleappengine/issues/detail?id=8471

Thomas Broyer

unread,
Mar 26, 2013, 5:18:17 PM3/26/13
to google-we...@googlegroups.com
That's interesting. Would you mind filing a bug? We should handle that better (fail at serialization rather than deserialization, with a better error message; or find a way to send the NaN: NaN cannot be represented in JSON)

Adrien Pinto

unread,
Aug 30, 2013, 3:40:49 PM8/30/13
to google-we...@googlegroups.com
I have the same issue. 

I was implementing a kind of filter for the user authentification on the Request Factory. I have subclassed my RequestFactoryServlet and I just check if the user is authentificate, if not I send a Redirection to the login page. So I think that my call from the client side is waiting for a particular response from the server, but the client never get it because I make a redirection and I don't call "super.doPost()" in the servlet.

But I don't understand why the RequestFactrory workflow don't fire the failure function on client side?

I don't think that a good way to make my login workflow any way. I will try to find authentification examples with Google Accounts with GWT/GAE.
Here is the stacktrace maybe it can help you :) 

java.lang.RuntimeException: Could not parse payload: payload[0] = <
	at com.google.web.bindery.autobean.vm.impl.JsonSplittable.create(JsonSplittable.java:70)
at com.google.web.bindery.autobean.shared.impl.StringQuoter.split(StringQuoter.java:73)
at com.google.web.bindery.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.java:54)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$StandardPayloadDialect.processPayload(AbstractRequestContext.java:351)
at com.google.web.bindery.requestfactory.shared.impl.AbstractRequestContext$5.onTransportSuccess(AbstractRequestContext.java:1151)
at com.google.web.bindery.requestfactory.gwt.client.DefaultRequestTransport$1.onResponseReceived(DefaultRequestTransport.java:136)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:242)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:293)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:724)

Le mercredi 29 mai 2013 00:37:22 UTC+2, Stephan White a écrit :
We just ran into the same issue.

SEVERE: Unexpected error

java.lang.RuntimeException: Could not parse payload: payload[0] = N
 at com.google.web.bindery.autobean.vm.impl.JsonSplittable.create(JsonSplittable.java:70)
 at com.google.web.bindery.autobean.shared.impl.StringQuoter.create(StringQuoter.java:46)
 at com.google.web.bindery.autobean.shared.ValueCodex$Type$7.encode(ValueCodex.java:125)
 at com.google.web.bindery.autobean.shared.ValueCodex.encode(ValueCodex.java:321)

 at com.google.web.bindery.autobean.shared.impl.AutoBeanCodexImpl$ValueCoder.extractSplittable(AutoBeanCodexImpl.java:500)
 at com.google.web.bindery.autobean.shared.impl.AbstractAutoBean.setProperty(AbstractAutoBean.java:277)
 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.server.Resolver$PropertyResolver.visitValueProperty(Resolver.java:155)

 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.server.Resolver.resolveClientValue(Resolver.java:414)
 at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.processInvocationMessages(SimpleRequestProcessor.java:491)
 at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:233)
 at com.google.web.bindery.requestfactory.server.SimpleRequestProcessor.process(SimpleRequestProcessor.java:135)
 at com.google.web.bindery.requestfactory.server.RequestFactoryServlet.doPost(RequestFactoryServlet.java:133)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
 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:662)

Thomas Broyer

unread,
Aug 31, 2013, 9:19:14 AM8/31/13
to google-we...@googlegroups.com

William Brophy

unread,
Sep 26, 2017, 2:33:40 PM9/26/17
to GWT Users
For anyone else still having this issue, I thought it may be helpful to share that I encountered a similar exception when attempting to construct a json number with an NaN value
Reply all
Reply to author
Forward
0 new messages