Spring 3.0 Ошибка: соответствующий шаблон является строгим, но не может быть найдено объявление для элемента - PullRequest
0 голосов
/ 28 декабря 2011

Я довольно новичок в среде Spring, так что простите, если это простой вопрос или ошибка новичка.Моя проблема в том, что когда я пытаюсь скомпилировать и развернуть свой проект, я получаю сообщение об ошибке:

The matching wildcard is strict, but no declaration can be found for element 'context:spring-configured'

Мой 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" />

Кажется, я не могу понять, почему он выдает сообщение об отсутствии объявления.Буду признателен за любую помощь или понимание

1 Ответ

5 голосов
/ 28 декабря 2011

Я думаю, что ваша xsi:schemaLocation декларация отсутствует http://www.springframework.org/schema/context

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...