Spring 安全拦截方法显示错误

Spring security intercept method shows error

    <beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="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-2.5.xsd
    http://www.springframework.org/schema/security
    http://www.springframework.org/schema/security/spring-security-2.0.1.xsd">

<bean id="messageBoardService" 
    class="com.service.MessageBoardServiceImpl">
    <security:intercept-methods>
    <security:protect 
        method="com.service.MessageBoardService.listMessages"
        access="ROLE_USER,ROLE_GUEST" />
    <security:protect 
        method="com.service.MessageBoardService.postMessage"
        access="ROLE_USER" />
    <security:protect 
        method="com.service.MessageBoardService.deleteMessage"
        access="ROLE_ADMIN,IP_LOCAL_HOST" />
    <security:protect 
        method="com.service.MessageBoardService.findMessageById"
        access="ROLE_USER,ROLE_GUEST" />
    </security:intercept-methods>
</bean>

通过执行上面的代码行显示错误

匹配的通配符是严格的,但是找不到元素的声明'bean'

安全拦截方法标签上出现红色下划线

这里是 jar 文件列表

此 header 添加到 xml 文件时。它工作正常

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