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.MappingException: Cannot cache an unknown entity: org.hibernate.test.legacy.Simple


 Caused by: org.hibernate.MappingException: Cannot cache an unknown entity: org.hibernate.test.legacy.Simple

at org.hibernate.cfg.Configuration.setCacheConcurrencyStrategy(Configuration.java:2023)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1568)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1449)

at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:601)

at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

... 37 more
出现这种异常多是在hibernate.cfg.xml中,多了以下这么一行代码:
<class-cache class="org.hibernate.test.legacy.Simple"  region="Simple" usage="read-write" />