您的位置:首页 > 编程语言 > Java开发

初学Spring遇到的第一个问题:bean.xml

2008-03-10 17:44 483 查看
问题:

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Line 2 in XML document from file [D:/Eclipse Workspace/MyEclipse 5.1/workspace/spring1/bean.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".

解决方法:
加一行:<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd"> 原因:没有申明类型即DTD文档类型定义
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐