SSH 使用HIBERNATE的ANNOTATION ...........报错:"
Caused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.feikecom.developer.po.Module"/>
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1648)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1491)
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)
... 39 more
解决 方案:
将SPRING 的配置文件 装配 SESSIONFACTORY的地方的CLASS
org.springframework.orm.hibernate3.LocalSessionFactoryBean
改成
org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean