如何在将旧版Google插件中的Appengine应用迁移到Google工具时修复错误.

Tom*_*Tom 5 java google-app-engine google-cloud-datastore google-cloud-platform

3 - 4年前,我使用数据存储技术构建了一个Appengine应用程序.那时,我们使用谷歌插件.我的应用程序非常完美,我能够毫无问题地部署它.

现在,我修改了它但无法部署它.有人告诉我将其迁移到Google工具.这是指南链接

我使用了新的eclipse(Oxygen)并安装了Eclipse的Cloud Tools.现在将我的旧项目转换为App Engine项目.我有一些错误:

- 1ST错误

cvc-complex-type.4: Attribute 'autoGenerate' must appear on element 'datastore-indexes'.
Run Code Online (Sandbox Code Playgroud)

在war\WEBG-INF\appengine生成的datastore-indexes-auto.xml文件中

  <!-- Indices written at Fri, 17 Aug 2018 19:43:56 ICT -->

**red mark here**   <datastore-indexes> 
    <!-- Used 1 time in query history -->
    <datastore-index kind="Conversation" ancestor="true" source="auto">
        <property name="LessonType" direction="asc"/>
        <property name="LessonNo" direction="asc"/>
    </datastore-index>

    <!-- Used 1 time in query history -->
    <datastore-index kind="Conversation" ancestor="true" source="auto">
        <property name="LessonType" direction="asc"/>
        <property name="ConversationNo" direction="asc"/>
        <property name="LessonNo" direction="asc"/>
    </datastore-index>

    <!-- Used 1 time in query history -->
    <datastore-index kind="Conversation" ancestor="true" source="auto">
        <property name="ConversationNo" direction="asc"/>
        <property name="LessonNo" direction="asc"/>
        <property name="LessonType" direction="asc"/>
        <property name="OrderNo" direction="asc"/>
    </datastore-index>

</datastore-indexes>
Run Code Online (Sandbox Code Playgroud)

- 第2次错误

Referenced file contains errors (http://java.sun.com/xml/ns/jdo/jdoconfig). For more information, right click on the message in the Problems View and select "Show Details..."
Run Code Online (Sandbox Code Playgroud)

在src/META-INF/中的jdoconfig.xml文件中

**red mark here** <?xml version="1.0" encoding="utf-8"?> 
**red mark here** <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
**red mark here**   xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

   <persistence-manager-factory name="transactions-optional">
       <property name="javax.jdo.PersistenceManagerFactoryClass"
           value="org.datanucleus.api.jdo.JDOPersistenceManagerFactory"/>
       <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
       <property name="javax.jdo.option.NontransactionalRead" value="true"/>
       <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
       <property name="javax.jdo.option.RetainValues" value="true"/>
       <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
       <property name="datanucleus.appengine.singletonPMFForName" value="true"/>
   </persistence-manager-factory>
</jdoconfig>
Run Code Online (Sandbox Code Playgroud)

我的项目在旧版Google插件上非常完美,但为什么我们在迁移后会遇到错误.

怎么解决?

Tom*_*Tom 5

我修好了它

改变<datastore-indexes><datastore-indexes autoGenerate="true">

并改变

<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
Run Code Online (Sandbox Code Playgroud)

<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">
Run Code Online (Sandbox Code Playgroud)

将解决问题,我能够部署它