简体   繁体   English

appengine-web.xml - XML 错误验证

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

when I try to deploy my App Engine Project, the following Valditation Error is shown:当我尝试部署我的 App Engine 项目时,会显示以下验证错误:

An internal error occurred during: "Deploying Guestbook to Google".在“将留言簿部署到 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 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

Here is my appengine-web.xml:这是我的 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>

Can anyone see the Validation Error?任何人都可以看到验证错误吗? Shall I post the appengine-web.xsd?我应该发布 appengine-web.xsd 吗?

you can only have 1 static-files element.你只能有 1 个static-files元素。 if you have multiple include , you should nest them all within a static-files element.如果你有多个include ,你应该将它们全部嵌套在一个static-files元素中。

thus the correct appengine-web.xml should be:因此正确的 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 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