2013年12月12日星期四

Error , the teacher taught me to use hibernate generate the table , but after a restart tomcat error

Serious : Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/ WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: org.crazyit.hrsystem.domain.gen.AccRes
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java: 1420)
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: 563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java: 895)
at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java: 425)
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: 4791)
at org.apache.catalina.core.StandardContext.startInternal (StandardContext.java: 5285)
at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java: 150)
at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java: 1559)
at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java: 1549)
at java.util.concurrent.FutureTask $ Sync.innerRun (Unknown Source)
at java.util.concurrent.FutureTask.run (Unknown Source)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (Unknown Source)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown Source)
at java.lang.Thread.run (Unknown Source)
Caused by: org.hibernate.MappingException: Association references unmapped class: org.crazyit.hrsystem.domain.gen.AccRes
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass (HbmBinder.java: 2473)
at org.hibernate.cfg.HbmBinder $ CollectionSecondPass.secondPass (HbmBinder.java: 2752)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass (CollectionSecondPass.java: 65)
at org.hibernate.cfg.Configuration.originalSecondPassCompile (Configuration.java: 1686)
at org.hibernate.cfg.Configuration.secondPassCompile (Configuration.java: 1393)
at org.hibernate.cfg.Configuration.buildMappings (Configuration.java: 1345)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (LocalSessionFactoryBean.java: 717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet (AbstractSessionFactoryBean.java: 211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java: 1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java: 1417)
... 22 more
2013-12-11 17:22:49 org.apache.catalina.core.StandardContext listenerStart
serious : 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 ServletContext resource [/ WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: org.crazyit.hrsystem.domain.gen.AccRes
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java: 1420)
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: 563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization (AbstractApplicationContext.java: 895)
at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java: 425)
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: 4791)
at org.apache.catalina.core.StandardContext.startInternal (StandardContext.java: 5285)
at org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java: 150)
at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java: 1559)
at org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java: 1549)
at java.util.concurrent.FutureTask $ Sync.innerRun (Unknown Source)
at java.util.concurrent.FutureTask.run (Unknown Source)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (Unknown Source)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run (Unknown Source)
at java.lang.Thread.run (Unknown Source)
Caused by: org.hibernate.MappingException: Association references unmapped class: org.crazyit.hrsystem.domain.gen.AccRes
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass (HbmBinder.java: 2473)
at org.hibernate.cfg.HbmBinder $ CollectionSecondPass.secondPass (HbmBinder.java: 2752)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass (CollectionSecondPass.java: 65)
at org.hibernate.cfg.Configuration.originalSecondPassCompile (Configuration.java: 1686)
at org.hibernate.cfg.Configuration.secondPassCompile (Configuration.java: 1393)
at org.hibernate.cfg.Configuration.buildMappings (Configuration.java: 1345)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory (LocalSessionFactoryBean.java: 717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet (AbstractSessionFactoryBean.java: 211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java: 1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (AbstractAutowireCapableBeanFactory.java: 1417)
... 22 more

should be the new table is not mapped , but do not know how to do, ask for help , and I just learned ssh, now feel good no clue , even a module to draw up , do not know how to do
------ Solution ------------------------------------------ -
hibernate configuration problem. Hair look to see
------ Solution ------------------------------------ --------
put your Hibernate.cfg.xml documents posted out ,
See the POJO object mapping files have no wrong , including the class path and basic attribute mapping .
if not wrong then see the POJO objects associated with the mapping file, the path to the POJO class object has no wrong
This estimate is pojo object path and attribute problems. .
------ For reference only -------------------------------------- -
say, is beginning to run , and then execute it wrong again after the restart tomcat it?
If this is the case , then troubleshoot the code . How does your tomcat restart ?
------ For reference only -------------------------------------- -
teacher did not get that done after the restart tomcat, he walked me to restart problems
------ For reference only ------------------- --------------------
amount , which in this configuration file ?
------ For reference only -------------------------------------- -
reported fault which has such a coursed by "Association references unmapped class: org.crazyit.hrsystem.domain.gen.AccRes"
------ For reference only - --------------------------------------

saw this log , http://www.itzhai.com/mappingexception-tips-association-references-unmapped-class-error-solution.html, found Hibernate.cfg.xml problems, not filled , but after adding or not , it is estimated POJO object mapping file in question , but I do not know what this mapping file corresponding to the file , how should I go
------ For reference only -------------- -------------------------
teacher did not get that done after the restart tomcat, he walked me to restart problems  
tomcat is how you reboot .
------ For reference only -------------------------------------- -
teacher did not get that done after the restart tomcat, he walked me to restart problems          
tomcat is how you reboot .   closed eclipse, restart tomcat
------ For reference only ---------------------------- -----------
well, there are two places did not add the path , one applicationContext.xml file to add org / crazyit / hrsystem / domain / gen / Resource.hbm. xml

One is Hibernate.cfg.xml file, add


------ For reference only ---------------------------------- -----

this line ah ? That teacher how did you first error . .

没有评论:

发表评论