错误:org.springframework.web.context.ContextLoader - 上下文初始化失败“spring”

时间:2017-07-12 20:11:01

标签: spring spring-mvc

当我尝试运行我的春季应用时出现错误。请帮助我。

错误:org.springframework.web.context.ContextLoader - 上下文初始化失败“spring”

enter image description here

根context.xml中

http://www.springframework.org/schema/beans/spring-beans.xsd“>

<!-- Root Context: defines shared resources visible to all other web components -->


<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
    <property name="url" value="jdbc:mysql://localhost:3306/test"></property>
    <property name="username" value="root"></property>
    <property name="password" value="root"></property>
</bean>

<bean id="sessionFactory"
    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory
            </prop>
        </props>
    </property>
    <property name="annotatedClasses">
        <list>
            <value>com.demo.login.beans.Customer</value>
        </list>
    </property>
</bean>

<bean id="transactionManager"
    class="org.springframework.orm.hibernate4.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<bean id="customerDao" class="com.demo.login.dao.CustomerDaoImpl">
    <property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<bean id="customerService" class="com.demo.login.services.CustomerServiceImpl">
    <property name="customerDao" ref="customerDao"></property>
</bean>

0 个答案:

没有答案