Java – matching wildcards are strict, but declarations cannot be found for elements

I'm using springsource Tools Suite 3 and trying to intercept

Servlet's context In XML

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<annotation-driven />

<resources mapping="/resources/**" location="/resources/" />

<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <beans:property name="prefix" value="/WEB-INF/views/" />
    <beans:property name="suffix" value=".jsp" />
</beans:bean>

<beans:bean id="authInterceptor" class="com.bank.accounting.authentication.AuthInterceptor" />
<beans:bean id="authUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

Unexpected failure during bean definition parsing: configuration problem: cannot find beandefinitionparser for element [list]

<beans:property name="interceptors">
        <list>

The matching wildcard is strict, but the element 'list' is not declared

<ref bean="authInterceptor" />
        </list>
    </beans:property>
    <beans:property name="mappings">
        <props>

Matching wildcards are strict, but the element "prop" is not declared

<prop key="/home">HomeController</prop>
        </props>
    </beans:property>
</beans:bean>
<beans:bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

Unexpected failure during bean definition parsing: configuration problem: beandefinitionparser for element [props] not found

<beans:property name="mappings">
        <props>

Matching wildcards are strict, but the element "prop" is not declared

<prop key="/login">LoginController</prop>
        </props>
    </beans:property>
</beans:bean>
</beans:beans>

Solution

The < list > and < ref > tags belong to util namespace Add it first:

xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"

These declarations are then prefixed appropriately:

<util:list>
  ...

You can also try < beans: util & gt

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>