javaxmleclipsexsdjdo

Why am I getting errors in jdoconfig.xml?


Eclipse marker tab shows some xml problem. This occurred when I checked dynamic web module in the Project Facets.

This is my project hierarchy :

enter image description here

jdconfig.xml (automatically generated) :

<?xml version="1.0" encoding="utf-8"?>
<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">

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

Errors shown in the marker window :

cvc-elt.1: Cannot find the declaration of element 'jdoconfig'.

What is the reason I am getting this error ?

Also,what is jdoconfig.xml ?


Solution

  • Because its wrong? This page has a simple example http://db.apache.org/jdo/jdoconfig_dtd.html

    The documentation of any JDO implementation would explain what that file is for, as would a simple internet search.

    A better XML header would be something like

    <jdoconfig xmlns="http://xmlns.jcp.org/xml/ns/jdo/jdoconfig"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdoconfig
            http://xmlns.jcp.org/xml/ns/jdo/jdoconfig_3_0.xsd" version="3.0">