zoukankan      html  css  js  c++  java
  • spring配置文件中配置sessionFactory失败

    配置失败主要原因有两个:

    <bean id="studentDaoImp" class="com.gxwuz.maven.dao.StudentDaoImp">
    <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>

    一是dao层的类没有写private SessionFactory sessionFactory;   和setSessionFactory方法(如上面的SudentDaoImp要写这些)

    二是spring的配置文件中配置sessionFactory时没配置好,如hibernate.cfg.xml文件路径配置错误而且必须配置dataSource,configLocation,mappingLocations如下图:

    当然configLocation也可以直接配置,如下图:

    当然mappingLocations也可以用另一种写法;

  • 相关阅读:
    windows nginx
    stdClass 标准
    array_merge
    array_pop
    array_push
    array_unique
    GMT与UTC简介(转)
    curl-手册
    13.5. zipfile — Work with ZIP archives
    7. Input and Output
  • 原文地址:https://www.cnblogs.com/chuangqi/p/10500616.html
Copyright © 2011-2022 走看看