Spring MVC:<cache:annotation-driven>生成从ServletContext资源解析XML文档的意外异常</cache:annotation-driven>

时间:2015-03-10 17:04:28

标签: java xml spring-mvc caching model-view-controller

我试图在spring MVC 3.2中配置缓存

由于我从未使用它,我只是按照一些方便的指南。我的问题是:生成Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInterceptor

我在eclipse中检查了build-path,一切正常。在我的spring-servlet.xml配置文件下面:

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


    <mvc:annotation-driven/>
    <cache:annotation-driven/>

<cache:annotation-driven/>之后添加的内容并不重要,它将以错误结束。只有当我删除注释缓存时,一切都以正确的方式工作。

因为在春季文档中对此进行了详细解释,我在这段代码中出错了吗?我需要某种外部库吗?

0 个答案:

没有答案