Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 325
Suhail Gupta Avatar asked Apr 10 '14 04:04

Suhail Gupta


2 Answers

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" >
like image 84
Pratap Singh Avatar answered Oct 19 '22 10:10

Pratap Singh


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">
like image 36
Protoxy Avatar answered Oct 19 '22 08:10

Protoxy