0

我的 App Engine、Java、GWT 应用程序仅在生产环境(而不是本地)中不断抛出以下错误。

问题似乎既不是我写的特定代码引起的(我们回滚了代码),也不是数据存储(我们用一个空的)。我们替换了一些相关的 jar 文件(如 requestfactory-api.jar)。这个问题让我很困惑...

有没有更深入的挖掘,找到失败点?

javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
java.lang.NoSuchFieldError: CHARSET_UTF8
    at com.google.gwt.user.server.rpc.impl.SerializabilityUtil.generateSerializationSignature(SerializabilityUtil.java:862)
    at com.google.gwt.user.server.rpc.impl.SerializabilityUtil.getSerializationSignature(SerializabilityUtil.java:333)
    at com.google.gwt.user.server.rpc.impl.SerializabilityUtil.encodeSerializedInstanceReference(SerializabilityUtil.java:217)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.getObjectTypeSignature(ServerSerializationStreamWriter.java:651)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:123)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:585)
    at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:605)
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:471)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:563)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.appengine.tools.appstats.AppstatsFilter.doFilter(AppstatsFilter.java:141)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:102)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:447)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:679)

.classpath 文件如下所示:我们现在首先尝试更新所有依赖项,然后删除特定库以解决错误。

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" path="test"/>
    <classpathentry kind="src" path=".apt_generated">
        <attributes>
            <attribute name="optional" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER/GWT"/>
    <classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER/App Engine"/>
    <classpathentry kind="con" path="com.google.gdt.eclipse.managedapis.MANAGED_API_CONTAINER/urlshortener-v1r7lv1.12.0-beta"/>
    <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/commons-fileupload-1.2.1.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/objectify-2.2.3.jar" sourcepath="/Users/manuel/Documents/workspace/objectify-2.2.3/src">
        <attributes>
            <attribute name="javadoc_location" value="file:/Users/manuel/Documents/workspace/objectify-2.2.3/javadoc/"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="lib" path="war/WEB-INF/lib/log4j-1.2.16.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/commons-io-1.4.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwt-dnd-3.1.1.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwtupload-gae-0.6.4-SNAPSHOT.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwtupload-0.6.4-20110712.073705-11.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwt-servlet-deps-1.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwt-maps-1.1.1.jar"/>
    <classpathentry kind="lib" path="war/WEB-INF/lib/gwt-urlshortener-v1-0.3-alpha.jar"/>
    <classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
4

1 回答 1

2

您使用的是哪个 GWT 版本?缺少字段错误似乎表明您的部分类是从一个版本的 GWT 加载的,而部分是从另一个版本加载的。

快速浏览 GWT 2.4.0 和 2.5.0 指出 SerializabilityUtil.generateSerializationSignature(SerializabilityUtil.java:862) 仅存在于 GWT 2.5.0 中,并且该字段位于 com.google.gwt.user.server.rpc .RPCServletUtils。相比之下,2.4.0 在 SerializabilityUtil 中没有足够的行数,并且有自己的字段来处理编码。如果你的类路径中混合了 2.4.0 和 2.5.0,它很可能会导致这样的问题。

于 2013-01-21T23:31:08.423 回答