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

后端 未结 1 1166
说谎
说谎 2021-01-25 01:27

I am new to Spring MVC. Tried to build the project with the security login, but can not start .war in tomcat.

FAIL - Application at context path /emplo

相关标签:
1条回答
  • 2021-01-25 01:49

    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.

    0 讨论(0)
提交回复
热议问题