Java cvc complex type.2.4.c:匹配的通配符是严格的,但是找不到元素';tx:注释驱动';
My mvc dispatcher servlet.xml::Java cvc complex type.2.4.c:匹配的通配符是严格的,但是找不到元素';tx:注释驱动';,java,spring,spring-security,Java,Spring,Spring Security,My mvc dispatcher servlet.xml:: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http:/
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:property-placeholder location="classpath:resources/database.properties" />
<context:component-scan base-package="com.suva.*" />
<tx:annotation-driven transaction-manager="hibernateTransactionManager"/>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${database.driver}" />
<property name="url" value="${database.url}" />
<property name="username" value="${database.user}" />
<property name="password" value="${database.password}" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
</property>
</bean>
</beans>
/WEB-INF/pages/
.jsp
${hibernate.dial}
${hibernate.show_sql}
${hibernate.hbm2ddl.auto}
我正在做一个spring安全应用程序,我必须用spring安全框架添加DB验证。
我已经在类路径中包含了正确的jar,但是我面临这个编译错误。。请指出我错在哪里
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
我已将我的xsd更改为此xsd定义,它现在正在工作。。正如Pathfinder2104所说,spring会自动获取最新的可用xsd。所以最好不要提及xsd的版本。您只想添加以下代码行
xmlns:mvc="http://www.springframework.org/schema/mvc"
以及
希望这能起作用。您使用的是哪个版本的Spring?我使用的是Spring-3.0 JAR..编译错误在下面的行::Don’为什么会发生这种情况。。我在类路径中有spring-tx-3.0.1.RELEASE.jar你在类路径中只有一个spring-jar版本吗?对我来说,这似乎是版本不匹配的事情,我最近遇到了它,我所做的是删除-3.0.xsd,而不是用名称try.xsd,我想spring会自动选择最新可用的xsd。并确保所有必需的JAR都已准备就绪。问题是“tx:annotation-driven”而不是“mvc:annotation-driven”
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd