在Tomcat上運行我的GWT應用程序時出現以下錯誤。 在Jetty上運行時,它工作正常。 我的代碼中沒有使用charAt
函數。在Tomcat上運行GWT應用程序時出現錯誤StringIndexOutOfBoundsException
我該如何找出這個錯誤?
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.Http11AprProcessor.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)
它不是您的代碼,而是來自Google .. http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/autobean/server /impl/JsonSplittable.java?r=9189。我不知道它是如何在Jetty上工作的...有沒有傳遞給tomcat的參數?或者可能是你正在傳遞參數,但爲空且非空 - >「」。 – hanumant 2011-05-09 11:07:37
@hanumant:Jetty和Tomcat的參數相同。 – Alex 2011-05-09 11:17:24