11

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 ?

Suhail Gupta
  • 19,563
  • 57
  • 170
  • 298

5 Answers5

31

Try this instead

  <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">
Protoxy
  • 469
  • 5
  • 11
1
cvc-elt.1: Cannot find the declaration of element 'jdoconfig'.

This is a validation error. It says, that when validating your XML file, parser couldn't find declaration for element <jdconfig> on the referred schema document.

In your case it is probably caused by two different things:

  1. The schemalocation http://java.sun.com/xml/ns/jdo/jdoconfig is incorrect, there is no schema in that address.
  2. The element <jdconfig> has a (default) namespace, yet the schema location refers to non-namespaced schema.
jasso
  • 13,108
  • 2
  • 33
  • 50
1

If there exists no schema as per 'xsi:noNamespaceSchemaLocation', then removing this attribute kills this validation error.

<?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" >
Pratap Singh
  • 273
  • 1
  • 3
  • 9
0
<?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:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig 
    http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd">
chirag
  • 1
  • 2
-2

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">
Neil Stockton
  • 10,531
  • 3
  • 28
  • 27