SerializationException in Google App Engine only.

2 views
Skip to first unread message

Cyril

unread,
Nov 6, 2009, 4:24:14 PM11/6/09
to gwt-sl
I am using GWT 1.7.1 - GXT 2.0.1 and GWT-SL 1.0. My application
works fine in hosted and web mode, however I have a
SerializationException when deploying to the google app engine. My
trace doesn't tell me which object is the culprit. Is there a way to
get more info in order to know what class need to be serialized?

Thanks a lot.

Here is my log:
11-06 12:42PM 28.288
javax.servlet.ServletContext log: Exception while dispatching incoming
RPC call
java.lang.RuntimeException:
com.google.gwt.user.client.rpc.SerializationException:
java.lang.reflect.InvocationTargetException
at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleExporterProcessingException
(GWTRPCServiceExporter.java:366)
at org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall
(GWTRPCServiceExporter.java:335)
at
com.gwtincubator.security.server.GWTRPCSecuredServiceExporter.processCall
(GWTRPCSecuredServiceExporter.java:87)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest
(GWTRPCServiceExporter.java:389)
at
org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle
(HttpRequestHandlerAdapter.java:49)
at org.springframework.web.servlet.DispatcherServlet.doDispatch
(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService
(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest
(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost
(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
at
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke
(FilterSecurityInterceptor.java:109)
at
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter
(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp
(SessionFixationProtectionFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp
(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp
(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp
(RememberMeProcessingFilter.java:109)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp
(SecurityContextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp
(BasicProcessingFilter.java:174)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.webapp.DefaultLoginPageGeneratingFilter.doFilterHttp
(DefaultLoginPageGeneratingFilter.java:86)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp
(AbstractProcessingFilter.java:278)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp
(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp
(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter
(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy
$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.util.FilterChainProxy.doFilter
(FilterChainProxy.java:175)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate
(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter
(DelegatingFilterProxy.java:167)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
(AppVersionHandlerMap.java:238)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:830)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable
(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
(JettyServletEngineAdapter.java:139)
at com.google.apphosting.runtime.JavaRuntime.handleRequest
(JavaRuntime.java:239)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5135)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:5133)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
363)
at com.google.net.rpc.impl.Server$2.run(Server.java:814)
at com.google.tracing.LocalTraceSpanRunnable.run
(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
(LocalTraceSpanBuilder.java:516)
at com.google.net.rpc.impl.Server.startRpc(Server.java:769)
at com.google.net.rpc.impl.Server.processRequest(Server.java:351)
at com.google.net.rpc.impl.ServerConnection.messageReceived
(ServerConnection.java:437)
at com.google.net.rpc.impl.RpcConnection.parseMessages
(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived
(RpcConnection.java:290)
at com.google.net.async.Connection.handl

George Georgovassilis

unread,
Nov 6, 2009, 5:15:08 PM11/6/09
to gwt...@googlegroups.com
Hello Cyril,

The stacktrace shows only the InvocationTargetException which is a
wrapper the reflection layer creates around the real exception. The
server log, like you noticed already, seems to not show the root cause.

You can get the GWTRpcServiceExporter.java file from the gzip archive
and change line 366 to print out the cause of the exception, compile it
and deploy that as a new JAR to your application, which should point you
to the real cause of the exception.

Cyril

unread,
Nov 9, 2009, 1:00:41 PM11/9/09
to gwt-sl
I finally figured it out. But first of all thanks to George for his
support on this matter.

1-First issue: how to get the Google app engine to display my log
output.
When using log4j, you must Set the default logging level for all
loggers to INFO in the logging.properties file.

2-After applying George's patch, I didn't get much more info, so I
decided to remove my security implementation, so it would give me more
info in the logs (org.springframework.security..).
Doing that I had the GAE complaining about linkedhashmap not being
serializable.
The linkedhashmap is part of the white list so I really don't know why
it's complaining. But after replacing the linkedhashmap by a hashmap
in my serialized class the problem finally went away!

This is caused by the fact that the accessOrder field of a
LinkedHashMap is set at
construction time, but there's no public method to retrieve it. Using
reflection is
viable in hosted and web mode, but is denied for security reasons in
AppEngine.

(see following post for more details:
http://74.125.95.132/search?q=cache:NMeBIaDxzksJ:code.google.com/p/google-web-toolkit/issues/detail%3Fid%3D3815+LinkedHashMap+InvocationTargetException&cd=2&hl=en&ct=clnk&gl=us)

On Nov 6, 5:15 pm, George Georgovassilis <g.georgovassi...@gmail.com>
wrote:

George Georgovassilis

unread,
Nov 10, 2009, 2:01:57 AM11/10/09
to gwt-sl
Thanks Cyril for sharing!

On 9 Nov, 19:00, Cyril <cyrilnes...@gmail.com> wrote:
> I finally figured it out. But first of all thanks to George for his
> support on this matter.
>
> 1-First issue: how to get the Google app engine to display my log
> output.
> When using log4j, you must Set the default logging level for all
> loggers to INFO in the logging.properties file.
>
> 2-After applying George's patch, I didn't get much more info, so I
> decided to remove my security implementation, so it would give me more
> info in the logs (org.springframework.security..).
> Doing that I had the GAE complaining about linkedhashmap not being
> serializable.
> The linkedhashmap is part of the white list so I really don't know why
> it's complaining. But after replacing the linkedhashmap by a hashmap
> in my serialized class the problem finally went away!
>
> This is caused by the fact that the accessOrder field of a
> LinkedHashMap is set at
> construction time, but there's no public method to retrieve it.  Using
> reflection is
> viable in hosted and web mode, but is denied for security reasons in
> AppEngine.
>
> (see following post for more details:http://74.125.95.132/search?q=cache:NMeBIaDxzksJ:code.google.com/p/go...)
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages