我一直在尝试使用Maven为Google提供的Java App Engine部署用于Java的Mirror API快速入门项目。
我从github(https://github.com/googleglass/mirror-quickstart-java)下载了代码,并在 oauth.properties 文件中更改了客户端ID和密码。
我通过简单的命令
成功地使它在localhost上工作mvn jetty:运行
但是,我现在无法在Google App Engine上部署它 我在 src \ main \ webapp \ WEB-INF \ 中添加了 appengine-web.xml ,其中包含以下内容
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>mirror-api-java-test1</application>
<version>1</version>
<threadsafe>true</threadsafe>
</appengine-web-app>
然后,我使用命令
创建了一个war文件战争:战争
并尝试使用以下命令进行部署
appcfg.cmd update \ target \ glass-java-starter-0.1-SNAPSHOT
我在尝试时遇到以下错误。
C:\Users\MCS\Desktop\mirror-quickstart-java-master>appcfg.cmd update target\glass-java-starter-0.1-SNAPSHOT
Reading application configuration data...
5월 14, 2014 6:10:56 오후 com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
정보: Successfully processed target/glass-java-starter-0.1-SNAPSHOT\WEB-INF/appengine-web.xml
5월 14, 2014 6:10:56 오후 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
정보: Successfully processed target/glass-java-starter-0.1-SNAPSHOT\WEB-INF/web.xml
Beginning interaction for module default...
Email: mcs8779@gmail.com
Password for mcs8779@gmail.com:
0% Created staging directory at: 'C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
5월 14, 2014 6:11:12 오후 com.google.apphosting.utils.config.AbstractConfigXmlReader getTopLevelNode
심각: Received IOException parsing the input stream for C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmp\WEB-INF/web.xml
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: invalid byte 3 of 3-byte utf-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:435)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1074)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:996)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:438)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:254)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:604)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3122)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
at org.mortbay.xml.XmlParser.parse(XmlParser.java:230)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(AbstractConfigXmlReader.java:207)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.parse(AbstractConfigXmlReader.java:229)
at com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:160)
at com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:20)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.readConfigXml(AbstractConfigXmlReader.java:112)
at com.google.apphosting.utils.config.WebXmlReader.readWebXml(WebXmlReader.java:87)
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:804)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:615)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:471)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1347)
at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:332)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:213)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:124)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:120)
5월 14, 2014 6:11:12 오후 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
심각: Received exception processing C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmp\WEB-INF/web.xml
com.google.apphosting.utils.config.AppEngineConfigException: Received IOException parsing the input stream for C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmpWEBINF/web.xml
at com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(AbstractConfigXmlReader.java:211)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.parse(AbstractConfigXmlReader.java:229)
at com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:160)
at com.google.apphosting.utils.config.WebXmlReader.processXml(WebXmlReader.java:20)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.readConfigXml(AbstractConfigXmlReader.java:112)
at com.google.apphosting.utils.config.WebXmlReader.readWebXml(WebXmlReader.java:87)
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:804)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:615)
at com.google.appengine.tools.admin.AppAdminImpl.doUpdate(AppAdminImpl.java:471)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:55)
at com.google.appengine.tools.admin.AppCfg$UpdateAction.execute(AppCfg.java:1347)
at com.google.appengine.tools.admin.AppCfg.executeAction(AppCfg.java:332)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:213)
at com.google.appengine.tools.admin.AppCfg.<init>(AppCfg.java:124)
at com.google.appengine.tools.admin.AppCfg.main(AppCfg.java:120)
Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: invalid byte 3 of 3-byte utf-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:687)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:435)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1074)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:996)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:438)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:254)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:604)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3122)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
at org.mortbay.xml.XmlParser.parse(XmlParser.java:230)
at com.google.apphosting.utils.config.AbstractConfigXmlReader.getTopLevelNode(AbstractConfigXmlReader.java:207)
... 14 more
Error Details:
5월 14, 2014 6:11:11 오후 org.apache.jasper.JspC processFile
정보: Built File: \index.jsp
com.google.apphosting.utils.config.AppEngineConfigException: Received IOException parsing the input stream for C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmp\WEB-INF/web.xml
Unable to update app: Received IOException parsing the input stream for C:\Users\MCS\AppData\Local\Temp\appcfg9012404692012972997.tmp\WEB-INF/web.xml
Please see the logs [C:\Users\MCS\AppData\Local\Temp\appcfg1078372849724416694.log] for further information.
请帮帮我! (我使用韩语版的Windows,因此错误日志中的某些字符可能看起来很奇怪)
答案 0 :(得分:0)
通过查看您收到的错误,应用程序的web.xml文件中的某个字节中出现了某种编码错误。我最好的猜测是,这是你用韩语键盘进行的流浪编辑。虽然韩语可能与任何其他语言一样编码为UTF-8,但非ASCII字符有大量precedent导致相同的错误。
我只是尝试用github中的a fresh copy替换当前的web.xml文件并重新编译项目。
如果这不起作用,请对MalformedByteSequenceException错误及其解决方法进行一些研究。似乎大多数人都找到了识别错误字符并删除它的方法,或者找到一种方法将文件重新编码为UTF-8。