gpt4 book ai didi

java - 将 Appengine 应用程序从旧的 Google 插件迁移到 Google 工具时如何修复错误?

转载 作者:搜寻专家 更新时间:2023-10-31 19:59:32 25 4
gpt4 key购买 nike

3-4 年前,我使用数据存储技术构建了一个 Appengine 应用程序。那时,我们使用 Google Plugin。我的应用程序非常完美,我可以毫无问题地部署它。

现在,我修改了它但无法部署它。有人告诉我将其迁移到 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..."

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

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

如何解决?

最佳答案

我修好了

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

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

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

关于java - 将 Appengine 应用程序从旧的 Google 插件迁移到 Google 工具时如何修复错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51907930/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com