I was getting 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 dispatcher servlet was having 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 all above by 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 error got disappeared.
How it happened can any one tell??
The schemaLocation
attribute references an XML Schema document for a namespace.
Basically when you type:
xmlns:expns="http://www.example.com" xsi:schemaLocation="http://www.example.com http://www.example.com/schema/example.xsd"
You are saying: "I'm going to use the prefix expns
for the elements of the namespace http://www.example.com
. Also, so you can validate those elements, get the XSD Schema file for http://www.example.com
in http://www.example.com/schema/example.xsd
"
So, in other words, the format is:
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 it must me an even number.
More info and examples can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With