I am getting the following error when running my GWT application on Tomcat.
When running it on Jetty it works fine.
I do not use the charAt
function in my code.
How can I trace down this error?
SEVERE: Unexpected error
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(Unknown Source)
at com.google.gwt.autobean.server.impl.JsonSplittable.create(JsonSplitta
ble.java:35)
at com.google.gwt.autobean.shared.impl.StringQuoter.split(StringQuoter.j
ava:35)
at com.google.gwt.autobean.shared.AutoBeanCodex.decode(AutoBeanCodex.jav
a:520)
at com.google.gwt.requestfactory.server.SimpleRequestProcessor.process(S
impleRequestProcessor.java:121)
at com.google.gwt.requestfactory.server.RequestFactoryServlet.doPost(Req
uestFactoryServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:298)
at org.apache.coyote.http11.Htt开发者_JAVA技巧p11AprProcessor.process(Http11AprProcesso
r.java:864)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:16
65)
at java.lang.Thread.run(Unknown Source)
This error means your servlet is receiving an empty request body (no length, empty string). There's probably something wrong in your Tomcat setup that strips the request body before it reaches your servlet. It's hard to tell, and I don't Tomcat much.
It works after cleaning Tomcat's work folder.
精彩评论