严重: 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 'testAction': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testService': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testDao': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [application.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [application.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: com.bbs.model.User, at table: topic, for columns: [org.hibernate.mapping.Column(user)]
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:305)

解决方案 »

  1.   

    spring的jar包我有导进去   有点郁闷的是  
    <property name="packagesToScan" >
        <list>
    <value>com.bbs.model</value>
        </list>
    </property>
    改成
    <property name="packagesToScan" >
    <list>
    <value>com.bbs.model.*</value>
    </list>
    </property>
    这样的时候就可以启动   但是我登录的时候就会出现 User is not mapped [from User u where u.name='ccc']; 
      

  2.   

    不能用.*来代替吧。
    <value>com.bbs.model.User</value>先试试!
      

  3.   

    <value>com.bbs.model.User</value>
    我这样弄的时候  它报的是User is not mapped [from User u where u.name='ccc'];