appengineRun失败,出现java.lang.NoClassDefFoundError:com / google / appengine / tools / development / ApiProxyLocal

时间:2014-05-14 10:45:05

标签: google-app-engine gradle

我在https://github.com/GoogleCloudPlatform/appengine-modules-sample-java上建立了一个新项目,但是当我在本地运行它时,我得到了错误(见下文)。即任务 appengineRun 失败,所以我想知道我缺少什么依赖。

Varning: failed JettyContainerService$ApiProxyHandler@c9eb8b5: java.lang.NoClassDefFoundError: com/google/appengine/tools/development/ApiProxyLocal
maj 14, 2014 11:59:31 FM com.google.apphosting.utils.jetty.JettyLogger warn 
Varning: Error starting handlers
java.lang.NoClassDefFoundError: com/google/appengine/tools/development/ApiProxyLocal
at    com.google.appengine.api.blobstore.dev.ServeBlobFilter.init(ServeBlobFilter.java:55)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:254)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:305)
at com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)
at com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:79)
at com.google.appengine.tools.development.Modules.startup(Modules.java:97)
at com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:255)
at com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)
at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:213)
at com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:211)
at java.security.AccessController.doPrivileged(Native Method)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:211)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:277)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48)
at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:219)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:210)
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.ApiProxyLocal
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:216)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 29 more

2 个答案:

答案 0 :(得分:0)

您的类路径存在问题 - 特别是使用appengine-testing.jar。如果你没有它,请将它添加到你的类路径中。如果已有,请将其删除,刷新项目,然后重新添加。请注意,您在/WEB-INF/lib文件夹中不需要它。

确保从正确版本的App Engine SDK添加此jar。你可以在(例如)中找到这个jar:

  

应用服务引擎的Java-SDK-1.9.6 / LIB /测试/应用服务引擎-testing.jar

答案 1 :(得分:0)

我们有两个依赖

  • 应用服务引擎 - 测试
  • appengine-api-stubs

在Maven或Gradle配置文件中, appengine-api-stubs appengine-testing 配置冲突。

删除 appengine-api-stubs 本地项目成功运行。