1

enter code here我正在尝试使用镜像 API。我是 Glass 的探险家。我的镜像 API 在 API 控制台中打开。

我遵循的说明在这里:

https://developers.google.com/glass/quickstart/java

我进入部署的第 2 步。我在 Windows 机器上并 cd 进入 app engine sdk bin 文件夹并运行指定的命令,但我将最后一个参数修改为完全限定。

它看起来像这样:

C:\Users\mscheel\Documents\Work\Glass\appengine-java-sdk-1.7.6\bin>appcfg.sh --o
auth2 update C:\Users\mscheel\Documents\Work\Glass\mirror-quickstart
-java-master\web

我第一次运行这个时,我得到一个带有 oauth 对话框的网络弹出窗口,并得到一个成功代码,我将其粘贴到正在运行的应用程序中,然后出现错误,就像我从后续运行中粘贴的这个:

Welcome to Git (version 1.7.9-preview20120201)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
********************************************************
There is a new version of the SDK available.
-----------
Latest SDK:
Release: 1.8.0
Timestamp: Wed May 01 12:01:15 MDT 2013
API versions: [1.0]

-----------
Your SDK:
Release: 1.7.6
Timestamp: Fri Mar 15 19:18:56 MDT 2013
API versions: [1.0]

-----------
Please visit https://developers.google.com/appengine/downloads for the latest SD
K.
********************************************************
Reading application configuration data...
May 27, 2013 11:29:15 AM com.google.apphosting.utils.config.AppEngineWebXmlReade
r readAppEngineWebXml
INFO: Successfully processed C:/Users/mscheel/Documents/Work/Glass/mirror-quicks
tart-java-master/web\WEB-INF/appengine-web.xml
May 27, 2013 11:29:15 AM com.google.apphosting.utils.config.AbstractConfigXmlRea
der readConfigXml
INFO: Successfully processed C:/Users/mscheel/Documents/Work/Glass/mirror-quicks
tart-java-master/web\WEB-INF/web.xml
Beginning server interaction for bitcoinupdate...
0% Created staging directory at: 'C:\Users\mscheel\AppData\Local\Temp\appcfg8499
594854129199289.tmp'
5% Using java7 runtime: false
8% Scanning for jsp files.
11% Compiling jsp files.

Error Details:
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilation
Context.java:238)
        at org.apache.jasper.JspCompilationContext.createCompiler(JspCompilation
Context.java:214)
        at org.apache.jasper.JspC.processFile(JspC.java:1181)
        at org.apache.jasper.JspC.execute(JspC.java:1341)
        at com.google.appengine.tools.development.LocalJspC.main(LocalJspC.java:
40)
Caused by: java.lang.NullPointerException
        at com.google.appengine.tools.development.LocalJspC$LocalCompiler.<clini
t>(LocalJspC.java:53)
        ... 7 more
Error while executing: C:\Program Files (x86)\Java\jre6\bin\java.exe -classpath
/C:/Users/mscheel/Documents/Work/Glass/appengine-java-sdk-1.7.6/lib/impl/appengi
ne-api-labs.jar;/C:/Users/mscheel/Documents/Work/Glass/appengine-java-sdk-1.7.6/
lib/impl/appengine-api-stubs.jar;/C:/Users/mscheel/Documents/Work/Glass/appengin
e-java-sdk-1.7.6/lib/impl/appengine-api.jar;/C:/Users/mscheel/Documents/Work/Gla
ss/appengine-java-sdk-1.7.6/lib/impl/appengine-local-runtime.jar;/C:/Users/msche
el/Documents/Work/Glass/appengine-java-sdk-1.7.6/lib/impl/google_sql.jar;C:\User
s\mscheel\Documents\Work\Glass\appengine-java-sdk-1.7.6\lib\shared\appengine-loc
al-runtime-shared.jar;C:\Users\mscheel\Documents\Work\Glass\appengine-java-sdk-1
.7.6\lib\shared\el-api.jar;C:\Users\mscheel\Documents\Work\Glass\appengine-java-
sdk-1.7.6\lib\shared\jsp\repackaged-appengine-ant-1.7.1.jar;C:\Users\mscheel\Doc
uments\Work\Glass\appengine-java-sdk-1.7.6\lib\shared\jsp\repackaged-appengine-a
nt-launcher-1.7.1.jar;C:\Users\mscheel\Documents\Work\Glass\appengine-java-sdk-1
.7.6\lib\shared\jsp\repackaged-appengine-jasper-6.0.29.jar;C:\Users\mscheel\Docu
ments\Work\Glass\appengine-java-sdk-1.7.6\lib\shared\jsp\repackaged-appengine-ja
sper-el-6.0.29.jar;C:\Users\mscheel\Documents\Work\Glass\appengine-java-sdk-1.7.
6\lib\shared\jsp\repackaged-appengine-tomcat-juli-6.0.29.jar;C:\Users\mscheel\Do
cuments\Work\Glass\appengine-java-sdk-1.7.6\lib\shared\jsp-api.jar;C:\Users\msch
eel\Documents\Work\Glass\appengine-java-sdk-1.7.6\lib\shared\servlet-api.jar;C:\
Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\classes;C
:\Users\mscheel\AppData\Local\Temp\1369675757138-0;C:\Users\mscheel\AppData\Loca
l\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\appengine-api-1.0-sdk-1.7.6.jar
;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\a
ppengine-api-labs-1.7.6.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854
129199289.tmp\WEB-INF\lib\commons-codec-1.7.jar;C:\Users\mscheel\AppData\Local\T
emp\appcfg8499594854129199289.tmp\WEB-INF\lib\commons-logging-1.1.2.jar;C:\Users
\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\google-api
-client-1.14.1-beta.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg84995948541291
99289.tmp\WEB-INF\lib\google-api-client-appengine-1.14.1-beta.jar;C:\Users\msche
el\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\google-api-clien
t-servlet-1.14.1-beta.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg849959485412
9199289.tmp\WEB-INF\lib\google-api-services-mirror-v1-rev2-1.14.1-beta.jar;C:\Us
ers\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\google-
http-client-1.14.1-beta.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854
129199289.tmp\WEB-INF\lib\google-http-client-appengine-1.14.1-beta.jar;C:\Users\
mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\google-http
-client-jackson-1.14.1-beta.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg849959
4854129199289.tmp\WEB-INF\lib\google-oauth-client-1.14.1-beta.jar;C:\Users\msche
el\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\google-oauth-cli
ent-appengine-1.14.1-beta.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg84995948
54129199289.tmp\WEB-INF\lib\google-oauth-client-servlet-1.14.1-beta.jar;C:\Users
\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\guava-14.0
.1.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF
\lib\httpclient-4.0.1.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg849959485412
9199289.tmp\WEB-INF\lib\httpcore-4.0.1.jar;C:\Users\mscheel\AppData\Local\Temp\a
ppcfg8499594854129199289.tmp\WEB-INF\lib\jackson-core-asl-1.9.11.jar;C:\Users\ms
cheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\jackson-mappe
r-asl-1.9.11.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.t
mp\WEB-INF\lib\jdo2-api-2.3-eb.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg849
9594854129199289.tmp\WEB-INF\lib\jsr305-1.3.9.jar;C:\Users\mscheel\AppData\Local
\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\repackaged-appengine-ant-1.7.1.j
ar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib
\repackaged-appengine-ant-launcher-1.7.1.jar;C:\Users\mscheel\AppData\Local\Temp
\appcfg8499594854129199289.tmp\WEB-INF\lib\repackaged-appengine-jakarta-jstl-1.1
.2.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF
\lib\repackaged-appengine-jakarta-standard-1.1.2.jar;C:\Users\mscheel\AppData\Lo
cal\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\repackaged-appengine-jasper-6
.0.29.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-
INF\lib\repackaged-appengine-jasper-el-6.0.29.jar;C:\Users\mscheel\AppData\Local
\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\repackaged-appengine-jasper-jdt-
6.0.29.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB
-INF\lib\repackaged-appengine-tomcat-juli-6.0.29.jar;C:\Users\mscheel\AppData\Lo
cal\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\servlet-api-2.5.jar;C:\Users\
mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\lib\transaction
-api-1.1.jar;C:\Users\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\W
EB-INF\lib\xpp3-1.1.4c.jar; -Dcom.google.apphosting.runtime.use_java7=false com.
google.appengine.tools.development.LocalJspC -uriroot C:\Users\mscheel\AppData\L
ocal\Temp\appcfg8499594854129199289.tmp -p org.apache.jsp -l -v -webinc C:\Users
\mscheel\AppData\Local\Temp\appcfg8499594854129199289.tmp\WEB-INF\generated_web.
xml -d C:\Users\mscheel\AppData\Local\Temp\1369675757138-0 -javaEncoding UTF-8


com.google.appengine.tools.admin.JspCompilationException: Failed to compile jsp
files.
Unable to update app: Failed to compile jsp files.
Please see the logs [C:\Users\mscheel\AppData\Local\Temp\appcfg49961834510221726
1.log] for further information.

我正在使用 Eclipse 并且要构建项目,我必须 a)使用 1.7.6 App Engine SDK,b)将我的 JRE 从 jre7 更改为 jdk1.6.0_25(否则我会遇到 JSP 问题)c)清除旧的 maven 并从新安装开始新的安装并清除旧设置

关于b:

在此处输入图像描述

任何想法mirror-api团队?还有其他人可以使用 Eclipse 在 Windows 上使用它吗?

在 Jenny Murphy 发表评论后,我分享了 maven compile 的输出,该输出成功并出现警告:

C:\Users\mscheel\Documents\Work\Glass\mirror-quickstart-java-master>mvn compile
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.google:glass-java-starter:jar:0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
 unique: javax.servlet:servlet-api:jar -> duplicate declaration of version 2.5 @
 line 73, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building glass-java-starter 0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:copy-dependencies (default) @ glass-java-
starter ---
[INFO] google-api-client-1.14.1-beta.jar already exists in destination.
[INFO] google-api-client-appengine-1.14.1-beta.jar already exists in destination
.
[INFO] google-api-client-servlet-1.14.1-beta.jar already exists in destination.
[INFO] google-api-services-mirror-v1-rev2-1.14.1-beta.jar already exists in dest
ination.
[INFO] appengine-api-1.0-sdk-1.7.6.jar already exists in destination.
[INFO] appengine-api-labs-1.7.6.jar already exists in destination.
[INFO] jsr305-1.3.9.jar already exists in destination.
[INFO] guava-14.0.1.jar already exists in destination.
[INFO] google-http-client-1.14.1-beta.jar already exists in destination.
[INFO] google-http-client-appengine-1.14.1-beta.jar already exists in destinatio
n.
[INFO] google-http-client-jackson-1.14.1-beta.jar already exists in destination.

[INFO] google-oauth-client-1.14.1-beta.jar already exists in destination.
[INFO] google-oauth-client-appengine-1.14.1-beta.jar already exists in destinati
on.
[INFO] google-oauth-client-servlet-1.14.1-beta.jar already exists in destination
.
[INFO] commons-codec-1.7.jar already exists in destination.
[INFO] commons-logging-1.1.2.jar already exists in destination.
[INFO] jdo2-api-2.3-eb.jar already exists in destination.
[INFO] servlet-api-2.5.jar already exists in destination.
[INFO] transaction-api-1.1.jar already exists in destination.
[INFO] httpclient-4.0.1.jar already exists in destination.
[INFO] httpcore-4.0.1.jar already exists in destination.
[INFO] jackson-core-asl-1.9.11.jar already exists in destination.
[INFO] jackson-mapper-asl-1.9.11.jar already exists in destination.
[INFO] xpp3-1.1.4c.jar already exists in destination.
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ glass-java
-starter ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\mscheel\Documents\Work\Glass
\mirror-quickstart-java-master\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ glass-java-star
ter ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.817s
[INFO] Finished at: Wed May 29 20:54:23 MDT 2013
[INFO] Final Memory: 8M/243M
[INFO] ------------------------------------------------------------------------
4

1 回答 1

1

我终于让它在我的 Windows 7 机器上工作:

    C:\Users\mscheel\Documents\Work\Glass\appengine-java-sdk-1.7.6\bin>appcfg.sh --o
auth2 update C:\Users\mscheel\Documents\Work\Glass\mirror-quickstart-java-master
\web
Welcome to Git (version 1.7.9-preview20120201)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
Reading application configuration data...
Jun 01, 2013 12:04:33 PM com.google.apphosting.utils.config.AppEngineWebXmlReade
r readAppEngineWebXml
INFO: Successfully processed C:/Users/mscheel/Documents/Work/Glass/mirror-quicks
tart-java-master/web\WEB-INF/appengine-web.xml
Jun 01, 2013 12:04:33 PM com.google.apphosting.utils.config.AbstractConfigXmlRea
der readConfigXml
INFO: Successfully processed C:/Users/mscheel/Documents/Work/Glass/mirror-quicks
tart-java-master/web\WEB-INF/web.xml
Beginning server interaction for bitcoinupdate...
0% Created staging directory at: 'C:\Users\mscheel\AppData\Local\Temp\appcfg3034
149135282611799.tmp'
5% Using java7 runtime: true
8% Scanning for jsp files.
11% Compiling jsp files.
warning: Supported source version 'RELEASE_6' from annotation processor 'com.goo
gle.appengine.tools.compilation.DatastoreCallbacksProcessor' less than -source '
1.7'
1 warning
Jun 01, 2013 12:04:36 PM com.google.apphosting.utils.config.AbstractConfigXmlRea
der readConfigXml
INFO: Successfully processed C:\Users\mscheel\AppData\Local\Temp\appcfg303414913
5282611799.tmp\WEB-INF/web.xml
20% Scanning files on local disk.
25% Initiating update.
28% Cloning 14 static files.
31% Cloning 73 application files.
40% Uploading 3 files.
52% Uploaded 1 files.
61% Uploaded 2 files.
68% Uploaded 3 files.
73% Initializing precompilation...
77% Sending batch containing 2 file(s) totaling 2KB.
80% Sending batch containing 1 blob(s) totaling 0KB.
90% Deploying new version.
95% Closing update: new version is ready to start serving.
98% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...

不幸的是,这需要付出很多努力,但最终的解决方案相当简单。但首先是问题。如果您在执行时查看我的原始帖子,您可以看到这一行:

Error while executing: C:\Program Files (x86)\Java\jre6\bin\java.exe -classpath

在顶部的代码片段中。

那个JRE很糟糕。我想使用JDK。我最终通过运行 Eclipse(尝试部署到应用程序引擎)发现了这一点,并在那里看到了更好的错误消息。

Eclipse 的解决方案是按照此处的说明修改我的 Eclipse.ini:

http://wiki.eclipse.org/Eclipse.ini

这会强制 eclipse 使用 JDK 而不是 JRE 以允许通过 eclipse 部署到应用程序引擎(让您通过 jsp 编译失败)。

我确切的ini文件片段是:

...
-vm
C:\Program Files\Java\jdk1.7.0_21\bin\javaw.exe
...

但这并没有通过命令行通过 appcfg 解决问题。此页面有解决方案:

https://code.google.com/p/googleappengine/issues/detail?id=1226

这似乎是特定于 Windows 的,对于至少以前安装 JRE 6 的任何人来说都是一个问题。您必须卸载所有旧的 JRE。请参阅该页面上的评论 #6。我通过 Windows 中的卸载应用程序 GUI 做到了这一点。

一旦我做了这两件事,我就不再有编译与镜像 api 相关的 JSP 的失败。

于 2013-06-01T18:13:18.240 回答