16
我得到以下錯誤錯誤:「schemaLocation值***必須有偶數個URI」。在春季調度命名空間
<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.
和我的分發程序Servlet爲具有下列命名空間
<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">
,我更換了所有上述通過以下
<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">
和我錯誤消失了。
它是如何發生的?
那麼你如何解決這個問題?你是否剛剛移除了未正確格式化的'xsi:schemaLocation',因爲它實際上並沒有做任何事情?你知道命名空間應該是什麼嗎?如果是這樣,怎麼樣? –
@StephenOstermiller您可以修復(添加對應項)xsi:schemaLocation中使其不均勻的條目,或者,如果您不知道conterpart的正確值,請刪除條目(因此不需要刪除整個'xsi:schemaLocation',儘管這也會起作用,我想)。 – acdcjunior