Spring 3.0错误:匹配的通配符是严格的,但是找不到元素的声明

Chr*_*ess 0 java model-view-controller spring

我是Spring框架的新手,请原谅我,如果这是一个简单的问题或新手的错误.我的问题是,当我尝试编译和部署我的项目时,我收到一个错误:

The matching wildcard is strict, but no declaration can be found for element 'context:spring-configured'
Run Code Online (Sandbox Code Playgroud)

我的调度程序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: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.0.xsd  http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:spring-configured/>
<context:annotation-config/>
<context:component-scan base-package="connect.controller"/>


<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>

<!--
Most controllers will use the ControllerClassNameHandlerMapping above, but
for the index controller we are using ParameterizableViewController, so we must
define an explicit mapping for it.
-->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props>
            <prop key="index.htm">indexController</prop>
            <prop key="main.htm">mainViewController</prop>
        </props>
    </property>
</bean>

<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" />

<!--
The index controller.
-->
<bean name="indexController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="index" />
Run Code Online (Sandbox Code Playgroud)

我似乎无法弄清楚为什么它会抛出No Declaration found错误.任何帮助或见解将不胜感激

art*_*tol 5

我认为你的xsi:schemaLocation声明遗失了http://www.springframework.org/schema/context