简体   繁体   中英

Migrating GAE project to Java 8 - get XML validation error after adding runtime property to appengine-web.xml

I'm migrating a GAE/GWT project to Java 8 and get the following error when deploying: XML error validating

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <runtime>java8</runtime>
    <application>XXXAppNameXXXX</application>
    <version>2</version>
    <!-- Allows App Engine to send multiple requests to one instance in parallel: -->
    <threadsafe>true</threadsafe>

    <!-- Configure serving/caching of GWT files -->
    <static-files>
        <include path="**" />

        <!-- The following line requires App Engine 1.3.2 SDK -->
        <include path="**.nocache.*" expiration="0s" />

        <include path="**.cache.*" expiration="365d" />
        <exclude path="**.gwt.rpc" />
    </static-files>

    <!-- Configure java.util.logging -->
    <system-properties>
        <property name="java.util.logging.config.file" value="WEB INF/logging.properties" />
    </system-properties>

</appengine-web-app>

against

/XXXX/XXXX/.p2/pool/plugins/com.google.appengine.eclipse.sdkbundle_1.9.34/appengine-java-sdk-1.9.34/docs/appengine-web.xsd

This error doesn't occur when I remove the java8 property but sans property, it deploys using Java 7 which causes other issues...

The error only occurs when I include the java8 property. The appengine-web.xsd file does NOT have a runtime property schema/def .

Is the missing property the root cause of the error? Should I use a different bundle? How can I resolve this?

First of all, I would suggest that you migrate from the Google Plugin bundle for Eclipse to Cloud Tools for Eclipse , because as stated in the documentation , the Plugin bundle has been deprecated as of January 2018:

The Google Plugin for Eclipse is deprecated and will be removed in January 2018. Migrate to Cloud Tools for Eclipse and/or the GWT Eclipse Plugin as soon as possible to avoid disruption.

In this other page you can find an easy step-by-step guide on how to perform the migration for App Engine Standard and GWT.

On another note, I would like to know why are you using an *.xsd file for defining appengine-web.xml .

Finally, you can also have a look at the official documentation for migrating existing Java7 apps to Java8 and verify that there is no additional component you should change in your application.

So in short, you should try migrating to Cloud Tools and then provide more information about the error (please share the full error report) if it keeps coming up.

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