Validating jdoconfig with incorrect url
Asked Answered
Z

4

10

I am using jdo and configuring the persistence manager with jdoconfig.xml

However everywhere I find documentation about jdoconfig.xml it states that http://java.sun.com/xml/ns/jdo/jdoconfig should be used for validation.

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

This url points to a nonexistent file and my xml validator reports an error. What is the purpose of even using this, can we ever trust that the urls will not change and all our xml files all of a sudden stops validating?

Does anyone know the new url?

Zenobiazeolite answered 18/5, 2011 at 9:24 Comment(0)
M
26

The xmlns is not a real file/directory, more a namespace, so ought not exist! The version is appended to get the real XSD file, namely http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd

Maybe

<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">
Metalworking answered 19/5, 2011 at 9:41 Comment(2)
So xsi:noNamespaceSchemaLocation should point to java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd ?Zenobiazeolite
You have two quatation marks after xmlns=. Even after I remove one of them, Eclipse still reports an error. Is it because the java.sun.com is now www.oracle.com? Can we include the jdoconfig_3_0.xsd in the META_INF and get done with it, although I have no idea where we can get it from?Lindeberg
K
2

Just replace

xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">

with

xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig http://java.sun.com/xml/ns/jdo/jdoconfig_3_0.xsd"
Knife answered 16/4, 2014 at 8:49 Comment(1)
That's exactly what the answer above states :)Zenobiazeolite
P
0

Changing jdoconfigile to use below worked for me.

   <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/jdo
Pectin answered 21/9, 2015 at 11:51 Comment(0)
H
0

In eclipse build path is pointing to the eclipse plugin jars, when i clean(removed the plugin path) my build path , i am facing the issue suddenly so i changed the xmlns path like below it was worked.

    <?xml version="1.0" encoding="UTF-8" ?>
    <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">  
Harsho answered 27/10, 2017 at 20:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.