简体   繁体   中英

appengine-web.xml - XML error validating

when I try to deploy my App Engine Project, the following Valditation Error is shown:

An internal error occurred during: "Deploying Guestbook to 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

Here is my 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?

you can only have 1 static-files element. if you have multiple include , you should nest them all within a static-files element.

thus the correct appengine-web.xml should be:

<?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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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