繁体   English   中英

appengine-web.xml - XML 错误验证

[英]appengine-web.xml - XML error validating

当我尝试部署我的 App Engine 项目时,会显示以下验证错误:

在“将留言簿部署到 Google”期间发生内部错误。 XML error validating C:\Users\Adrian\workspace\Guestbook\war\WEB-INF\appengine-web.xml against C:\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.5.0.r36v201105092302\appengine-java -sdk-1.5.0\docs\appengine-web.xsd

这是我的 appengine-web.xml:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>adrianschaeferandroid</application>
    <version>1</version>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
    </system-properties>
    <static-files>
        <include path="/favicon.ico" />
    </static-files>
    <static-files>
        <include path="stylesheets/main.css" />
    </static-files>

</appengine-web-app>

任何人都可以看到验证错误吗? 我应该发布 appengine-web.xsd 吗?

你只能有 1 个static-files元素。 如果你有多个include ,你应该将它们全部嵌套在一个static-files元素中。

因此正确的 appengine-web.xml 应该是:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>adrianschaeferandroid</application>
    <version>1</version>

    <system-properties>
        <property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
    </system-properties>
    <static-files>
        <include path="/favicon.ico" />
        <include path="stylesheets/main.css" />
    </static-files>

</appengine-web-app>

You will find it a lot easier to not make such errors if you configure your app GAE/Java app using an app.yaml file to generate both the web.xml and appengine-web.xml: https://developers.google.com /appengine/docs/java/configyaml/appconfig_yaml

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM