【问题标题】:How to fix errors when migrating Appengine app from old Google Plugin into Google Tools.?将 Appengine 应用程序从旧 Google 插件迁移到 Google 工具时如何修复错误。?
【发布时间】:2019-01-25 05:40:51
【问题描述】:

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

现在,我对其进行了修改,但无法部署它。有人告诉我将其迁移到 Google 工具。这里是the guide link

我使用了新的 Eclipse (Oxygen) 并安装了 Cloud Tools for Eclipse。现在将我的旧项目转换为 App Engine 项目后。我遇到了一些错误:

-第一次错误

cvc-complex-type.4: Attribute 'autoGenerate' must appear on element 'datastore-indexes'.

datastore-indexes-auto.xml 文件中的 war\WEBG-INF\appengine-generated

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

-第二个错误

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..."

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

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

我的项目在旧的谷歌插件上很完美,但是为什么我们在迁移后得到了错误。

如何解决?

【问题讨论】:

    标签: java google-app-engine google-cloud-platform google-cloud-datastore


    【解决方案1】:

    我修好了

    &lt;datastore-indexes&gt; 更改为&lt;datastore-indexes autoGenerate="true"&gt;

    改变

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

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

    会解决问题并且我能够部署它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多