gpt4 book ai didi

spring - "The matching wildcard is strict, but no declaration can be found for element ' mvc :annotation-driven'?

转载 作者:行者123 更新时间:2023-12-03 00:18:55 27 4
gpt4 key购买 nike

我的 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:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
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.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

我的 spring jar 文件是 3.2 版本
为什么会出现以下错误:
“匹配通配符严格,但找不到元素‘mvc:annotation-driven’的声明”

最佳答案

您的 xsi:schemaLocation 属性中缺少 mvc 和上下文条目。

像这样更改您的xsi:schemaLocation

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

关于spring - "The matching wildcard is strict, but no declaration can be found for element ' mvc :annotation-driven'?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21642952/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com