---
title: "'mvc:annotation-driven' must have no character or element information item [chil"
author: "kfc_davy"
date: "2013-07-18T16:27:33Z"
tags: []
categories: ["编程语言"]
slug: "mvc-annotation-driven-must-have-no-character-or-element-information-item-chil"
draft: false
lastmod: "2013-07-18T16:27:33Z"
id: 1909704
url: "https://kfc-davy.iteye.com/blog/1909704"
---

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 39 in XML document from class path resource  is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element 'mvc:annotation-driven' must have no character or element information item , because the type's content type is empty.



```java

	<mvc:annotation-driven>
		<mvc:message-converters register-defaults="true">
			<bean 
		        class="org.springframework.http.converter.StringHttpMessageConverter">
		        <property name="supportedMediaTypes">
		            <list>
					<value>text/plain;charset=UTF-8</value>
					</list>
		        </property>
		    </bean>
		</mvc:message-converters>
	</mvc:annotation-driven>

```



原先spring包是3.0，替换为3.1即可