Java Spring 3.0错误:匹配的通配符是严格的,但找不到元素的声明
我对Spring框架非常陌生,所以如果这是一个简单的问题或新手犯的错误,请原谅我。我的问题是,当我试图编译和部署我的项目时,我得到了一个错误:Java Spring 3.0错误:匹配的通配符是严格的,但找不到元素的声明,java,spring,model-view-controller,Java,Spring,Model View Controller,我对Spring框架非常陌生,所以如果这是一个简单的问题或新手犯的错误,请原谅我。我的问题是,当我试图编译和部署我的项目时,我得到了一个错误: The matching wildcard is strict, but no declaration can be found for element 'context:spring-configured' 我的dispatcher xml文件包含以下内容: <?xml version="1.0" encoding="UTF-8"?> &
The matching wildcard is strict, but no declaration can be found for element 'context:spring-configured'
我的dispatcher 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" />
索引控制器
主视图控制器
我似乎不明白为什么会抛出“未发现声明”错误。任何帮助或见解都将不胜感激我认为您的
xsi:schemaLocation
声明缺失http://www.springframework.org/schema/context
我认为您的xsi:schemaLocation
声明缺失http://www.springframework.org/schema/context
谢谢你的帮助。但是,这会导致另一个错误:Java.lang.NoClassDefFoundError:org/aspectj/lang/NoAspectBoundException这听起来像是版本不匹配。最好问一个新问题,这样我们就可以看了。(如果你使用Maven,发布你的POM)谢谢你的帮助。但是,这会导致另一个错误:Java.lang.NoClassDefFoundError:org/aspectj/lang/NoAspectBoundException这听起来像是版本不匹配。最好问一个新问题,这样我们就可以看它了。(如果你使用Maven,发布你的POM)