Error: "schemaLocation value *** must have an even number of URIs". on namespaces in spring manager

I was getting the following error

<Ignored XML validation warning> org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 55; SchemaLocation: schemaLocation value = 'http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx' must have even number of URI's. 

and my dispatch servlet had the following namespaces

 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> 

and I replaced everything above following

 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

And my mistake has disappeared.
How could this happen?

+15
java xml spring-mvc xsd
May 21 '13 at 5:47
source share
1 answer

The schemaLocation refers to the XML Schema document for the namespace.

Mostly when entering:

 xmlns:expns="http://www.example.com" xsi:schemaLocation="http://www.example.com http://www.example.com/schema/example.xsd" 

You say: "I'm going to use the expns prefix for the namespace elements of http://www.example.com . You can also check these elements, get the XSD schema file for http://www.example.com at http://www.example.com/schema/example.xsd "

So, in other words, the format:

 xsi:schemaLocation="namespace-a where_to_get_the_xsd_for_namespace-a namespace-b where_to_get_the_xsd_for_namespace-b namespace-c where_to_get_the_xsd_for_namespace-c" 

And so on.

That's why I even need a number.


More information and examples can be found here .

+54
May 23 '13 at 17:57
source share



All Articles