spring配置中异常:org.xml.sax.SAXParseException: cvc-complex-type.2.4.c:

来源:互联网 发布:新闻自动生成软件 编辑:程序博客网 时间:2024/05/22 08:20

spring配置xml文件中如果xml书写格式有误,或者xml头部的信息缺失了,就会报这样的错。org.xml.sax.SAXParseException: cvc-complex-type.2.4.c

这下面错误的原因是因为applicationContext.xml中的头部少了东西;配置事务管理要在头部 xsi:schemaLocation=  中加上这段代码: http://www.springframework.org/schema/tx   http://www.springframework.org/schema/tx/spring-tx-2.5.xsd   

 这样才能使用事务的传播特性 <tx:advice id="txAdvice" transaction-manager="transactionManager"> 


错误:org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:advice'.

原创粉丝点击