3-4 years ago, I built an Appengine app using datastore technique. At that time, we use Google Plugin. My app was perfect, I was able to deploy it without any problems.
Now, I modified it but couldn't deploy it. Someone told me to migrate it to Google tools. Here is the guide link
I used new eclipse (Oxygen) & installed Cloud Tools for Eclipse. Now after converting my old project to App Engine Project. I got some errors:
-1ST ERROR
cvc-complex-type.4: Attribute 'autoGenerate' must appear on element 'datastore-indexes'.
in datastore-indexes-auto.xml file in 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>
-2nd ERROR
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..."
in jdoconfig.xml file in 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>
My project was perfect on old Google Plugin, but why do we got the errors after migration.
How to fix it?
I fixed it
change <datastore-indexes>
to <datastore-indexes autoGenerate="true">
and change
<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">
to
<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">
would fix the problem & I was able to deploy it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With