3

我正在为 Google Glass 开发 Glassware。我想看看我是否可以将 Glassware 上传到 App Engine,所以我得到了支持 App Engine 的最新版本(位于 GitHub 上:https ://github.com/googleglass/mirror-quickstart-java/releases/tag/app -引擎)。我更改了 API 代码和我的 App Engine 应用程序名称,并使用 Eclipse 上的 Google App Engine SDK 和 appcfg.cmd 通过命令提示符将其部署到 App Engine。部署它时,我收到以下错误:

Failed to compile the generated JSP java files to App Engine

我得到的完整错误如下(这是来自它的命令提示符版本):

warning: Supported source version 'RELEASE_6' from annotation processor 'com.goo
gle.appengine.tools.compilation.DatastoreCallbacksProcessor' less than -source '
1.7'
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:7: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Contact;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:11: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.TimelineItem;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:12: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Subscription;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:13: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Attachment;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:7: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Contact;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:11: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.TimelineItem;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:12: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Subscription;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:13: error: package com.google.api.services.mirror.model does not exist
import com.google.api.services.mirror.model.Attachment;
                                           ^
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:69: error: cannot find symbol
  Contact contact = MirrorClient.getContact(credential, MainServlet.CONTACT_NAME
);
  ^
  symbol:   class Contact
  location: class index_jsp
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:69: error: cannot access Contact
  Contact contact = MirrorClient.getContact(credential, MainServlet.CONTACT_NAME
);
                                           ^
  class file for com.google.api.services.mirror.model.Contact not found
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:71: error: cannot find symbol
  List<TimelineItem> timelineItems = MirrorClient.listItems(credential, 3L).getI
tems();
       ^
  symbol:   class TimelineItem
  location: class index_jsp
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:71: error: cannot access TimelineListResponse
  List<TimelineItem> timelineItems = MirrorClient.listItems(credential, 3L).getI
tems();
                                                           ^
  class file for com.google.api.services.mirror.model.TimelineListResponse not f
ound
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav
a:74: error: cannot find symbol
  List<Subscription> subscriptions = MirrorClient.listSubscriptions(credential).
getItems();
       ^
  symbol:   class Subscription
  location: class index_jsp
C:\Users\Family3\AppData\Local\Temp\1382233159652-0\org\apache\jsp\index_jsp.jav

Index.jsp 位于此处:https ://github.com/googleglass/mirror-quickstart-java/blob/8a7edd5eb8c2710b841294ca5d7d69bd176693bf/web/index.jsp

由于某种原因,mirror.model jar 旁边有一个奇怪的源图标。其他罐子都没有。它的图片如下:在此处输入图像描述我可能会从另一个地方得到这个罐子吗?

另外,有人建议添加

<packaging>war</packaging>

到 pom.xml。这也没有解决问题,它与我之前遇到的错误相同。

我不知道为什么会收到此错误。JSP 文件似乎有问题,但这是 Glass 团队发布的版本。也许我需要改变其中的一些东西?也许是某些罐子有问题?谢谢您的帮助。

4

1 回答 1

1

我有同样的问题,我通过添加解决了它

<packaging>war</packaging>

在 pom.xml 中,所以 pom.xml 文件是:

`

<modelVersion>4.0.0</modelVersion>
<groupId>com.google</groupId>
<artifactId>glass-java-starter</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

` 现在我正在使用以下命令编译并上传到应用引擎

mvn clean install
appcfg.sh update target/glass-java-starter-0.1-SNAPSHOT

如果您仍然有问题,请告诉我。

于 2013-10-25T09:05:07.793 回答