我正在为Google Glass开发Glassware。我想看看我是否可以将Glassware上传到App Engine,所以我得到了支持App Engine的最新版本(位于GitHub上:https://github.com/googleglass/mirror-quickstart-java/releases/tag/app-engine)。我更改了API代码和我的App Engine应用程序名称,并使用Eclipse上的Google App Engine SDK将其部署到App Engine。 appcfg.cmd通过命令提示符。部署它时,我遇到以下错误:
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团队发布的版本。也许我需要改变一些东西?也许这是一些罐子的问题?谢谢你的帮助。
答案 0 :(得分: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>
` 现在我使用下面的命令编译并上传到app引擎
mvn clean install
appcfg.sh update target/glass-java-starter-0.1-SNAPSHOT
如果您仍有问题,请告诉我。