can be found for element 'tx:annotation-driven'

错误描述:

ERROR [ContainerBackgroundProcessor[StandardEngine[Catalina]]] (ContextLoader.java:308) - Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 46 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 46; columnNumber: 57; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'

解决方案:

1、检查xmlns:tx="http://www.springframework.org/schema/tx"是否拼写合适,是否有多余的空格;

2、检查xsi:schemaLocation中是否包含http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd这两项。

原文地址:https://www.cnblogs.com/yaoyinglong/p/annotation-driven.html