Why am I getting errors in jdoconfig.xml?
Asked Answered
B

5

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 ?

Bashemath answered 10/4, 2014 at 4:54 Comment(0)
B
-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">
Buttock answered 10/4, 2014 at 6:51 Comment(1)
This did not work for me. The answer from Protoxy worked for me.Sciomachy
H
32

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">
Haff answered 24/2, 2015 at 23:6 Comment(2)
it has fixed the problem!Punner
Is it possible for this answer to include why this worked? (Upvoted anyway since it did fix the problem).Philtre
G
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" >
Guinna answered 26/12, 2019 at 11:1 Comment(0)
M
0
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.
Marelya answered 10/4, 2014 at 6:52 Comment(0)
H
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">
Heritor answered 9/11, 2017 at 6:31 Comment(0)
B
-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">
Buttock answered 10/4, 2014 at 6:51 Comment(1)
This did not work for me. The answer from Protoxy worked for me.Sciomachy

© 2022 - 2024 — McMap. All rights reserved.