当前位置: 代码迷 >> Java Web开发 >> Error creating bean with name 'sessionFactory' defined in class path resource解决方法
  详细解决方案

Error creating bean with name 'sessionFactory' defined in class path resource解决方法

热度:3082   发布时间:2013-02-25 21:12:19.0
Error creating bean with name 'sessionFactory' defined in class path resource
Java code
2009-8-6 9:47:06 org.apache.catalina.core.AprLifecycleListener init信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Program Files\MyEclipse 6.0\bin;D:\Program Files\MyEclipse 6.0\myeclipse\eclipse\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_6.0.1.zmyeclipse601200710\tomcat\bin2009-8-6 9:47:06 org.apache.coyote.http11.Http11Protocol init信息: Initializing Coyote HTTP/1.1 on http-80802009-8-6 9:47:06 org.apache.catalina.startup.Catalina load信息: Initialization processed in 637 ms2009-8-6 9:47:06 org.apache.catalina.core.StandardService start信息: Starting service Catalina2009-8-6 9:47:06 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.132009-8-6 9:47:08 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContextlog4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).log4j:WARN Please initialize the log4j system properly.2009-8-6 9:47:10 org.apache.catalina.core.StandardContext listenerStart严重: 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.MappingNotFoundException: resource: com/whda/entity/Immobility.hbm.xml not foundCaused by: org.hibernate.MappingNotFoundException: resource: com/whda/entity/Immobility.hbm.xml not found    at org.hibernate.cfg.Configuration.addResource(Configuration.java:563)    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587)    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)    at org.hibernate.cfg.Configuration.configure(Configuration.java:1443)    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:634)    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)    at org.apache.catalina.core.StandardService.start(StandardService.java:516)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)    at java.lang.reflect.Method.invoke(Unknown Source)    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)2009-8-6 9:47:10 org.apache.catalina.core.StandardContext start严重: Error listenerStart2009-8-6 9:47:10 org.apache.catalina.core.StandardContext start严重: Context [/hdDate] startup failed due to previous errors2009-8-6 9:47:10 org.apache.catalina.core.ApplicationContext log信息: Closing Spring root WebApplicationContext2009-8-6 9:47:10 org.apache.coyote.http11.Http11Protocol start信息: Starting Coyote HTTP/1.1 on http-80802009-8-6 9:47:10 org.apache.jk.common.ChannelSocket init信息: JK: ajp13 listening on /0.0.0.0:80092009-8-6 9:47:10 org.apache.jk.server.JkMain start信息: Jk running ID=0 time=0/78  config=null2009-8-6 9:47:10 org.apache.catalina.startup.Catalina start信息: Server startup in 4119 ms
  相关解决方案