首页 > 解决方案 > 找不到 BeanDefinitionParser

问题描述

我在使用 mvc:resources 映射资源时遇到问题。我收到以下错误:Cannot locate BeanDefinitionParser for element [resources] Offending resource: ServletContext resource [/WEB-INF/spring-servlet.xml]

我正在使用 Spring 3.2.3 和 Eclipse。spring-webmvc.jar 在构建路径上。我相信我的架构设置正确。如果有人可以提供帮助,我将不胜感激。谢谢!

<beans 
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    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:context="http://www.springframework.org/schema/context"  

    xsi:schemaLocation="
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
    http://www.springframework.org/schema/beans  
    http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
    http://www.springframework.org/schema/context  
    http://www.springframework.org/schema/context/spring-context-3.2.xsd">  

标签: javaspring

解决方案


解决了。原来这是一个罐子冲突。构建路径中有多个挥之不去的 org.springframework.*.3.0.1 jar。一旦我删除了这些,它就起作用了。


推荐阅读