web工程之启动时spring的dtd错误 [/WEB-INF/applicationContext.xml
来源:互联网 发布:加权并查集算法 编辑:程序博客网 时间:2024/05/02 00:54
2005-10-13 10:14:04,237 INFO [org.springframework.beans.factory.support.Default ListableBeanFactory] - Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [propertyConfigurer,dataSource,sessionFactory,tran sactionManager,userDAO,userManagerTarget,userManag er]; root of BeanFactory hierarchy}
2005-10-13 10:14:04,237 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.MappingException: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
org.hibernate.MappingException: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection refused: connect
at org.hibernate.cfg.Configuration.addInputStream(Con figuration.java:408)
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:608)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:962)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:354)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:223)
从服务器上(这里指svn,cvs等版本控制工具)check out之后,写好自己负责的业务逻辑之后,发布到应用服务器(tomcat) ,发生了莫名其妙的错误;错误的信息如下:
2009-7-16 14:18:22 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [newspweb-lib.xml]; nested exception is java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
)
也没什么特别的提示,从提示的英文看上去貌似什么网络出了问题,socket什么什么的;上百度搜索了一下,解决的方法可谓五花八门,但是到头来没一个是可以搞定的;有些就说spring在启动的时候先从applicationContext文件里面声明的网络地址(如http://www.springframework.org/dtd/等)去找,如果网络上找不到(如你电脑不能上网;或公司对网络有限制,我们公司就这样,比较恶心),就到本地文件来找,这里的本地就是spring.jar这个包里面的文件;其实我发现完全 不是那么一回事,我认为spring根本就没有上网找,而是直接从本地(在包spring.jar解压后得到目录下spring/org/springframework/beans/factory/xml/spring-beans****.dtd路径下可以找到)里面找搞了半天终于找到解决的方案原来是spring配置文件的dtd出了问题
把
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dt
替换成
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
之后 ,问题得到了解决;归根结底就是Eclipse的插件版本的问题,这些问题真的很隐蔽,提示也很模糊,让你 哭笑不得,在这里总结一下,顶!
http://devbbs.doit.com.cn/thread-507-1-1.html
http://forum.springsource.org/archive/index.php/t-18861.html
- web工程之启动时spring的dtd错误 [/WEB-INF/applicationContext.xml
- 解释为什么Spring 默认会加载/WEB-INF/applicationContext.xml
- spring源码解析之默认配置文件名/WEB-INF/applicationContext.xml
- 启动tomcat服务时,报解析/WEB-INF/applicationContext.xml异常或找不到该文件
- Maven项目配置spring时 出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方案
- 读取WEB-INF 下applicationContext.xml配置文件
- web.xml的dtd
- springMVC之web.xml,spring-mvc.xml与applicationContext.xml
- 解决Maven项目启动Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- eclipse创建maven工程没有src/main/resources文件夹和web.xml使用3.1的dtd时工程有错误的问题
- 关于IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]的解决
- spring的applicationContext.xml在web.xml中的配置详解
- spring web.xml applicationContext.xml常见配置
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- dorado7 Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决
- 用XMPP4r来集成IM ——需要避免的错误
- DirectX、DirectShow关系等
- 夏天里的一阵凉风
- 泛型算法系列12:fill()&&fill_n()
- 安装APK文件到Android模拟器和Android sdcard的使用
- web工程之启动时spring的dtd错误 [/WEB-INF/applicationContext.xml
- Discount
- [转]键盘上每个按键的用途
- 开发者不可不知的PHP框架深度解析
- 推出自己的产品!
- 众数问题
- Linux未来猜想:被遗忘还是终结Windows?
- 数据库簇的操作
- 中移动与腾讯迟早必有一战