Tomcat: FAIL - Application at context path /employee could not be started

梦想与她 提交于 2019-12-02 04:07:57
Alfabravo

The log states: "No matching bean of type [org.hibernate.SessionFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency".

You could define it in the applicationContext.xml as shown in this question. Using ApplicationContext in Spring MVC.

It would be something like

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"></property>
        <property name="mappingResources">
          <list>
            <value>UserAccount.hbm.xml</value>
            ...
          </list>
        </property>
        <property name="hibernateProperties">
          <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            </props>
        </property>
      </bean>

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!