Error creating Bean with Name ' sessionfactory ' defined in class path resource [APPLICATIONCONTEXT.XM

Source: Internet
Author: User
Tags addchild

The error message is as follows:
<span style= "FONT-SIZE:24PX;" >17:18:32,245 ERROR Contextloader:307-context Initialization Failedorg.springframework.beans.factory.BeanCreationException:Error creating Bean with Name ' sessionfactory ' defined In class path resource [Applicationcontext.xml]: Invocation of Init method failed; Nested exception is org.hibernate.InvalidMappingException:Could no parse mapping document from input Streamat org.spring Framework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1486) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:524) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:461) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:295) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.Getsingleton (defaultsingletonbeanregistry.java:223) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:292) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:194) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:589) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:932) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:479) at Org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext (contextloader.java:383) At Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:283) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:112) at Org.apache.catalina.core.StandardContext.listEnerstart (standardcontext.java:5003) at Org.apache.catalina.core.StandardContext.startInternal ( standardcontext.java:5517) at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150) at Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:901) at Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:877) at Org.apache.catalina.core.StandardHost.addChild (standardhost.java:652) at Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1263) at Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1948) at Java.util.concurrent.executors$runnableadapter.call (executors.java:441) at java.util.concurrent.futuretask$ Sync.innerrun (futuretask.java:303) at Java.util.concurrent.FutureTask.run (futuretask.java:138) at Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908) at Java.lang.Thread.run ( thread.java:619) caused by: Org.hibernate.InvalidMappingException:Could not parse mapping document from input Streamat Org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxml (configuration.java:4009) at Org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxmlqueue (configuration.java:3998) at Org.hibernate.cfg.configuration$metadatasourcequeue.processmetadata (configuration.java:3986) at Org.hibernate.cfg.Configuration.secondPassCompile (configuration.java:1398) at Org.hibernate.cfg.Configuration.buildMappings (configuration.java:1375) at Org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (Localsessionfactorybean.java : 720) at Org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet ( abstractsessionfactorybean.java:188) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1545) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (abstractautowirecapablebeanfactory.java:1483) ... Morecaused By:org.hibernate.PropertyNotFoundException:field [ordertime] not found on Cn.itcast.shop.order.vo.Orderat Org.hibernate.property.DirectPropertyAccessor.getField ( directpropertyaccessor.java:182) at Org.hibernate.property.DirectPropertyAccessor.getField ( directpropertyaccessor.java:174) at Org.hibernate.property.DirectPropertyAccessor.getGetter ( directpropertyaccessor.java:197) at Org.hibernate.util.ReflectHelper.getter (reflecthelper.java:241) at Org.hibernate.util.ReflectHelper.reflectedPropertyClass (reflecthelper.java:229) at Org.hibernate.mapping.SimpleValue.setTypeUsingReflection (simplevalue.java:316) at Org.hibernate.cfg.HbmBinder.createProperty (hbmbinder.java:2297) at Org.hibernate.cfg.HbmBinder.createClassProperties (hbmbinder.java:2274) at Org.hibernate.cfg.HbmBinder.createClassProperties (hbmbinder.java:2164) at Org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues (hbmbinder.java:412) at Org.hibernate.cfg.HbmBinder.binDrootclass (hbmbinder.java:326) at Org.hibernate.cfg.HbmBinder.bindRoot (hbmbinder.java:177) at Org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxml (configuration.java:4006) ... more2016-7-18 17:18:32 org.apache.catalina.core.StandardContext listenerstart severity: Exception Sending context Initialized event to listener instance of class Org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException:  Error creating Bean with Name ' sessionfactory ' defined in class path resource [Applicationcontext.xml]: Invocation of Init Method failed; Nested exception is org.hibernate.InvalidMappingException:Could no parse mapping document from input Streamat org.spring Framework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1486) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:524) at Org.springframework. Beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (Abstractautowirecapablebeanfactory.java : 461) at Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (AbstractBeanFactory.java:295) At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:223) at Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:292) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:194) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:589) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:932) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:479) at Org.springframework.web.context.ContextLoader.configureAndRefreshWebApPlicationcontext (contextloader.java:383) at Org.springframework.web.context.ContextLoader.initWebApplicationContext (contextloader.java:283) at Org.springframework.web.context.ContextLoaderListener.contextInitialized (contextloaderlistener.java:112) at Org.apache.catalina.core.StandardContext.listenerStart (standardcontext.java:5003) at Org.apache.catalina.core.StandardContext.startInternal (standardcontext.java:5517) at Org.apache.catalina.util.LifecycleBase.start (lifecyclebase.java:150) at Org.apache.catalina.core.ContainerBase.addChildInternal (containerbase.java:901) at Org.apache.catalina.core.ContainerBase.addChild (containerbase.java:877) at Org.apache.catalina.core.StandardHost.addChild (standardhost.java:652) at Org.apache.catalina.startup.HostConfig.deployDirectory (hostconfig.java:1263) at Org.apache.catalina.startup.hostconfig$deploydirectory.run (hostconfig.java:1948) at Java.util.concurrent.executors$runnableadapter.call (executors.java:441) at java.util.concurrent.futuretask$ Sync.innerrun (Futuretask.java:303) at Java.util.concurrent.FutureTask.run (futuretask.java:138) at Java.util.concurrent.threadpoolexecutor$worker.runtask (threadpoolexecutor.java:886) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:908) at Java.lang.Thread.run ( thread.java:619) caused by:org.hibernate.InvalidMappingException:Could not parse mapping document from input Streamat or G.hibernate.cfg.configuration$metadatasourcequeue.processhbmxml (configuration.java:4009) at Org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxmlqueue (configuration.java:3998) at Org.hibernate.cfg.configuration$metadatasourcequeue.processmetadata (configuration.java:3986) at Org.hibernate.cfg.Configuration.secondPassCompile (configuration.java:1398) at Org.hibernate.cfg.Configuration.buildMappings (configuration.java:1375) at Org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (Localsessionfactorybean.java : 720) at Org.springframework.orm.hibernate3.AbstractSessionFactoryBean.Afterpropertiesset (abstractsessionfactorybean.java:188) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods ( abstractautowirecapablebeanfactory.java:1545) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1483) ... Morecaused By:org.hibernate.PropertyNotFoundException:field [ordertime] not found on Cn.itcast.shop.order.vo.Orderat Org.hibernate.property.DirectPropertyAccessor.getField ( directpropertyaccessor.java:182) at Org.hibernate.property.DirectPropertyAccessor.getField ( directpropertyaccessor.java:174) at Org.hibernate.property.DirectPropertyAccessor.getGetter ( directpropertyaccessor.java:197) at Org.hibernate.util.ReflectHelper.getter (reflecthelper.java:241) at Org.hibernate.util.ReflectHelper.reflectedPropertyClass (reflecthelper.java:229) at Org.hibernate.mapping.SimpleValue.setTypeUsingReflection (simplevalue.java:316) at Org.hibernate.cfg.HbmBinder.createPrOperty (hbmbinder.java:2297) at Org.hibernate.cfg.HbmBinder.createClassProperties (hbmbinder.java:2274) at Org.hibernate.cfg.HbmBinder.createClassProperties (hbmbinder.java:2164) at Org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues (hbmbinder.java:412) at Org.hibernate.cfg.HbmBinder.bindRootClass (hbmbinder.java:326) at Org.hibernate.cfg.HbmBinder.bindRoot ( hbmbinder.java:177) at Org.hibernate.cfg.configuration$metadatasourcequeue.processhbmxml (Configuration.java:4006 )... more2016-7-18 17:18:32 org.apache.catalina.core.StandardContext startinternal severity: One or more listeners failed to start . Full details would be found in the appropriate container log file2016-7-18 17:18:32 Org.apache.catalina.core.StandardContex T startinternal severity: Context [/shop] startup failed due to previous errors2016-7-18 17:18:32 Org.apache.catalina.core.Appli Cationcontext Log Info: Closing Spring root webapplicationcontext2016-7-18 17:18:32 Org.apache.catalina.startup.HostConfig deploydirectory Info: Deployment of WeB application directory H:\ITOO\apache-tomcat-7.0.64\webapps\shop have finished in 2,913 ms2016-7-18 17:18:32 Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["http-bio-8080"]2016-7-18 17:18:32 Org.apache.coyote.AbstractProtocol Start Info: Starting Protocolhandler ["ajp-bio-8009"]2016-7-18 17:18:32 Org.apache.catalina.startup.Catalina Start Information: Server Startup in 8001 ms</span>

The effect is: Originally the picture of the clothes to jump to an initial interface two images are as follows:


Solution: Based on

caused By:org.hibernate.PropertyNotFoundException:field [ordertime] not found on Cn.itcast.shop.order.vo.Order


The following error was found: The field in the entity in Vo and the fields in the mapping file are not uniform, resulting in the mapping file not found


Error creating Bean with Name ' sessionfactory ' defined in class path resource [APPLICATIONCONTEXT.XM

Related Article

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.