The reported exception:
Severity: Exception sending context initialized event to listener instance of class Org.springframework.web.context.ContextLoad Erlistener
Org.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' sessionfactory ' defined in Class path resource [Spring/applicationcontext-db.xml]: Invocation of Init method failed; Nested exception is org.hibernate.InvalidMappingException:Could no parse mapping document from File C:\apache-tomcat-8. 0.36\webapps\crm-zhengshiban\web-inf\classes\com\ljr\crm\domain\crmstudent.hbm.xml
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1412)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:519)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:456)
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:291)
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:222)
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:288)
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:190)
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:546)
At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:872)
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:423)
At Org.springframework.web.context.ContextLoader.createWebApplicationContext (contextloader.java:276)
At Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:197)
At Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:47)
At Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:4842)
At Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5303)
At Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:147)
At Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:725)
At Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:701)
At Org.apache.catalina.core.StandardHost.addChild (standardhost.java:717)
At Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1092)
At Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1834)
At Java.util.concurrent.executors$runnableadapter.call (executors.java:471)
At Java.util.concurrent.FutureTask.run (futuretask.java:262)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615)
At Java.lang.Thread.run (thread.java:744)
caused by:org.hibernate.InvalidMappingException:Could not parse mapping document from File C:\apache-tomcat-8.0.36\ Webapps\crm-zhengshiban\web-inf\classes\com\ljr\crm\domain\crmstudent.hbm.xml
At Org.hibernate.cfg.Configuration.addFile (configuration.java:406)
At Org.hibernate.cfg.Configuration.addDirectory (configuration.java:764)
At Org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (Localsessionfactorybean.java : 710)
At Org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet ( abstractsessionfactorybean.java:211)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1469)
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1409)
... More
caused by:org.dom4j.DocumentException:Connection timed out:connect Nested exception:connection timed out:connect< /c0>
At Org.dom4j.io.SAXReader.read (saxreader.java:484)
At Org.dom4j.io.SAXReader.read (saxreader.java:264)
At Org.hibernate.cfg.Configuration.addFile (configuration.java:392)
... More
Cause: An error occurred in the DTD import URL for 1.*.hbm.xml or hibernate.cfg.xml file header.
Possible error forms:
<! DOCTYPE hibernate-mapping Public
"-//hibernate/hibernate Mapping DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
Solution:
Locate the Hibernate3.jar, open the HIBERNATE-MAPPING-3.0.DTD and hibernate-configuration-3.0.dtd files in the jar package, respectively, and compare your
The <! is filled in DOCTYPE ....> is not with these two files in the <! The DOCTYPE ....> correspond correctly respectively. Using the <! inside the file. DOCTYPE ....> can be solved
Problem! (Report a workaround for this exception, I test correctly!) )
Correct form:
*.hbm.xml in: <! DOCTYPE hibernate-mapping Public
"-//hibernate/hibernate Mapping DTD 3.0//en"
"Http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
The Hiberante.cfg.xml is: <! DOCTYPE hibernate-configuration Public
"-//hibernate/hibernate Configuration DTD 3.0//en"
"Http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
Configuration prior to modification
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE hibernate-mapping Public
"-//hibernate/hibernate Mapping DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
After modification
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE hibernate-mapping Public
"-//hibernate/hibernate Mapping DTD 3.0//en"
"Http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
hibernate3.0 org.dom4j.DocumentException:Connection timed Out:connect Nested exception: