GWT-GAE:错误:部署应用程序后NOT_FOUND

时间:2013-01-30 13:49:40

标签: google-app-engine gwt

我尝试部署我的应用程序,该应用程序还将数据存储在应用程序引擎的数据存储区中。我使用objectify库来访问数据存储区。本地运行没有问题,我可以在本地访问管理数据存储区。但是当我尝试部署它时,虽然eclipse说它已经成功部署,但当我尝试使用url时,我收到一个错误:NOT_FOUND。 在日志中(在app引擎中)有两个警告:

com.google.api.server.spi.response.ServletResponseResultWriter getWriteObjectifyKeyAsStringModule: Exception while resolving Objectify Key#getString
java.lang.NoSuchMethodException: com.googlecode.objectify.Key.getString()
at com.google.appengine.runtime.Request.process-16096d3fb5bf337e(Request.java)
at java.lang.Class.getMethod(Class.java:216)
at com.google.api.server.spi.response.ServletResponseResultWriter.getWriteObjectifyKeyAsStringModule(ServletResponseResultWriter.java:154)
at com.google.api.server.spi.response.ServletResponseResultWriter.<init>(ServletResponseResultWriter.java:57)
at com.google.api.server.spi.SystemServiceServlet.getResponseWriter(SystemServiceServlet.java:127)
at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:107)
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 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
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 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 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
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 java.lang.Thread.run(Thread.java:679)

com.google.api.server.spi.request.ServletRequestParamReader getObjectifyKeyModule: Exception while resolving Objectify Key#create
       java.lang.NoSuchMethodException: com.googlecode.objectify.Key.create(java.lang.String)
at com.google.appengine.runtime.Request.process-16096d3fb5bf337e(Request.java)
at java.lang.Class.getMethod(Class.java:216)
at com.google.api.server.spi.request.ServletRequestParamReader.getObjectifyKeyModule(ServletRequestParamReader.java:147)
at com.google.api.server.spi.request.ServletRequestParamReader.<init>(ServletRequestParamReader.java:131)
at com.google.api.server.spi.SystemServiceServlet.getParamReader(SystemServiceServlet.java:122)
at com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:140)
at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:112)
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 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
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 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 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
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)

我有4个rpc方法,看起来很多,所以我要举一例其中一个:

greetingService:

@RemoteServiceRelativePath("registration")
public interface GreetingService extends RemoteService {
    String greetServer(String email, String pass, String rPass, int job ) throws IllegalArgumentException;

}

异步:

public interface GreetingServiceAsync {
    void greetServer(String email, String pass, String rPass, int job, AsyncCallback<String> callback) throws IllegalArgumentException;
}

和Impl:

@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService {

    static {
        ObjectifyService.register(LoginUser.class);
    }

    public String greetServer(String email, String pass, String rPass, int job) throws IllegalArgumentException {

        Objectify ofy = ObjectifyService.begin();

        LoginUser user = new LoginUser();

        if (!FieldVerifier.isValidName(email)) {
            throw new IllegalArgumentException("Name must be at least 4 characters long");
        }
        if (!FieldVerifier.isValidPass(pass, rPass)) {
            throw new IllegalArgumentException("Password and Repeat Password do not match!");
        } else {
            user.setEmail(email);
            user.setPassword(pass);
            user.setJob(job);
            ofy.put(user);
        }

        return email;
    }
}

任何想法??

2 个答案:

答案 0 :(得分:0)

我从来没有发现问题是什么。我只是重新安装gwt和gae,创建了一个新项目,我能够部署它。

答案 1 :(得分:0)

我遇到了同样的问题。然后我意识到我在war / WEB-INF / lib中有objectify-3.0.jar Key.getString()方法显然只添加到3.1版本中,所以在用objectify-3.1.jar替换objectify-3.0.jar之后问题就消失了。