报错信息如下:
<span style="font-size:24px;">17:18:32,245 ERROR ContextLoader:307 - Context initialization failed org.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 not parse mapping document from input stream at org.springframework.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 stream at 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) ... 26 more Caused by: org.hibernate.PropertyNotFoundException: field [ordertime] not found on cn.itcast.shop.order.vo.Order at 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) ... 34 more 2016-7-18 17:18:32 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.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 not parse mapping document from input stream at org.springframework.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 stream at 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) ... 26 more Caused by: org.hibernate.PropertyNotFoundException: field [ordertime] not found on cn.itcast.shop.order.vo.Order at 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) ... 34 more 2016-7-18 17:18:32 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 2016-7-18 17:18:32 org.apache.catalina.core.StandardContext startInternal 严重: Context [/shop] startup failed due to previous errors 2016-7-18 17:18:32 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2016-7-18 17:18:32 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory H:\ITOO\apache-tomcat-7.0.64\webapps\shop has finished in 2,913 ms 2016-7-18 17:18:32 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 2016-7-18 17:18:32 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 2016-7-18 17:18:32 org.apache.catalina.startup.Catalina start 信息: Server startup in 8001 ms</span>
出现的影响是:本来衣服的图片却跳转到了一个最初的界面两个图片分别如下:
解决方案:根据
Caused by: org.hibernate.PropertyNotFoundException: field [ordertime] not found on cn.itcast.shop.order.vo.Order
发现如下错误:vo中的实体中的字段和映射文件中的字段不统一,导致的,找不到映射文件
Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
时间: 2024-12-15 07:11:52