[英]Google App Engine - java.lang.NoClassDefFoundError: com.google.appengine.api.datastore.DatastoreServiceFactory
I have an app that is successfully uploading content to a server on Google´s App Engine. 我有一个可以成功将内容上传到Google App Engine上的服务器的应用程序。 What I wanna do now, is retrieve that content using a DataStore constructed like this: 我现在想做的是使用这样构造的DataStore检索内容:
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Whenever I call that line, I get the following error: 每当我拨打该行时,都会出现以下错误:
09-05 11:21:37.922: E/AndroidRuntime(27138): FATAL EXCEPTION: AsyncTask #2
Caused by: java.lang.NoClassDefFoundError:
com.google.appengine.api.datastore.DatastoreServiceFactory
I´m unsure at the moment if the problem lies on the application itself, or on the AppEngine. 目前,我不确定问题是否出在应用程序本身还是AppEngine上。 I have already tried to add some suggested JARs to my buildpath, for example appengine-agent.jar and appengineagentimpl.jar without success. 我已经尝试将一些建议的JAR添加到我的构建路径中,例如appengine-agent.jar和appengineagentimpl.jar都没有成功。
I would deeply appreciate any inputs on this. 我对此深表感谢。 Thanks! 谢谢!
Note that DatastoreServiceFactory is only available on the server-side. 请注意,DatastoreServiceFactory仅在服务器端可用。 If that's the case, then you need to add required jars to your war/WEB-INF/lib/ folder. 如果是这种情况,则需要将所需的jar添加到war / WEB-INF / lib /文件夹中。 It's not enough to have them on your buildpath. 仅将它们放在您的构建路径中是不够的。
If you use Eclipse, click on the Problems tab. 如果使用Eclipse,请单击“问题”选项卡。 You may see a warning saying that this jar is not available on a server. 您可能会看到一条警告,说该jar在服务器上不可用。 Right click on this warning, select QuickFix, select "Copy..." option. 右键单击此警告,选择“快速修复”,然后选择“复制...”选项。 Or copy this jar to this directory manually. 或手动将此jar复制到此目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.