Spring's DTD error when WEB project starts [/web-inf/applicationcontext.xml__web

Source: Internet
Author: User
Tags abstract socket
I have put in the latest dom4j-1.6.1, and Spring 1.2.5, and Hibernate 3.0.5, and I am still getting the following message. Any and thing I can do? Thank.


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)

After check out from the server (this is the version control tool such as SVN,CVS), after you have written your own business logic, you publish to the application Server (Tomcat), and the error message is as follows:

2009-7-16 14:18:22 Org.apache.catalina.core.StandardContext Listenerstart
Severity: Exception sending context initialized event to listener instance of class Org.springframework.web.context.ContextLoad Erlistener
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)
)
There is no special hint, from the hint of English looks like what the network out of the problem, socket what what, Baidu Search, the solution is a variety of methods, but in the end no one can be done; Some say spring in the start time from the ApplicationContext file inside the declaration of the network address (such as http://www.springframework.org/dtd/, etc.) to find, if not found on the network (such as your computer can not access the Internet; Or the company has restrictions on the network, our company is so, more disgusting, to the local file to find, here is Spring.jar this package of local files; in fact, I found that it is not all that way, I think spring is not on the Internet, but directly from the local ( After the package Spring.jar decompression to get the directory under the SPRING/ORG/SPRINGFRAMEWORK/BEANS/FACTORY/XML/SPRING-BEANS****.DTD path can be found) It's been a long, long way to find a solution. There was a problem with the DTD for the spring configuration file.
Put
<! DOCTYPE beans Public "-//spring//dtd BEAN 2.0//en" "Http://www.springframework.org/dtd/spring-beans-2.0.dt
Replaced by
<! DOCTYPE beans Public "-//spring//dtd bean//en" "Http://www.springframework.org/dtd/spring-beans.dtd" >

After that, the problem has been resolved, in the final analysis, Eclipse plug-in version of the problem, these problems are really hidden, hints are very vague, let you laugh and cry, summed up here, the top!

Http://devbbs.doit.com.cn/thread-507-1-1.html

Http://forum.springsource.org/archive/index.php/t-18861.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.