初学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文档类型定义
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文档类型定义
相关文章推荐
- 搭建SSH框架遇到的struts.xml找不到spring定义的bean的错误(配置文件的路径问题)
- spring的beans.xml中引用jdbc.properties遇到的问题
- spring注解与xml同时使用:bean命名问题及冲突
- 初学Spring Boot遇到的启动问题
- spring.xml遇到的一些问题1
- spring注解与xml同时使用:bean命名问题及冲突
- maven工程打包遇到Unable to locate Spring NamespaceHandler for XML schema namespace问题
- spring-servlet.xml 和 application.xml 配置含义及bean被加载两次的问题
- Spring中bean.xml的连接池配置问题详解
- 单点登录(十一)-----遇到问题-----cas启用mongodb验证方式报错--Unable to locate Spring NamespaceHandler for XML schema na
- spring加载xml文件 读取bean时遇到的一个问题
- ssh整合启动tomcat遇到的问题 Error creating bean with name 'org.springframework.transaction.interceptor.Transa
- 解决服务器代码执行mvn test后在classes和test-classes下找不到Spring的bean.xml配置文件问题
- Spring里遇到的一个问题,autowired时报找不到bean定义
- 单点登录(十一)-----遇到问题-----cas启用mongodb验证方式报错--Unable to locate Spring NamespaceHandler for XML schema na
- spring学习中遇到的坑之 xml约束导入问题
- springboot学习中遇到的问题---初学时404错误
- spring+quartz实现定时任务遇到问题总结(bean无法注入)
- Spring配置web.xml文件时遇到的问题
- Spring里遇到的一个问题,autowired时报找不到bean定义