单元测试启动就报错了,不知道是哪里错了?帮忙看看错误啊

来源:3-6 dao层开发

慕粉3604928

2018-06-27 14:49

 Error creating bean with name 'areaDao' defined in file
[E:\javacode\springbootmybatisdemo\target\classes\com\spring\springbootmybatisdemo\dao\AreaDao.class]:

Unsatisfied dependency expressed through bean property 'sqlSessionFactory';

nested exception is org.springframework.beans.factory.BeanCreationException:

Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/spring/springbootmybatisdemo/config/dao/SessionFactoryConfiguration.class]:

Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:

 Failed to parse config resource: class path resource [mybatis-config.xml];

nested exception is org.apache.ibatis.builder.BuilderException:

Error parsing SQL Mapper Configuration. Cause:

org.apache.ibatis.builder.BuilderException:

 The setting userColumnLabel is not known.  

Make sure you spelled it correctly (case sensitive).

写回答 关注

2回答

  • 慕粉3604928
    2018-06-27 20:03:52

    已经找到原因了,mybatis-config.xml中需要将下面这个配置注释掉,不然就会报错!
    <setting name="userColumnLabel" value="true" />

    qq_谐星_...

    把这个注释掉那些值就取不到了啊,驼峰命名没了,后面怎么办啊兄弟。我你一样的问题,注释掉了就不报错了,但是有些值就取不到了。

    2018-06-28 22:06:35

    共 1 条回复 >

  • 慕移动0132182
    2018-06-27 16:51:56

    你看下数据库配置是否有误,可以断点查看

    createSqlSessionFactoryBean

    方法体中 读取的mysql和用户名密码的配置内容

SpringBoot+MyBatis搭建迷你小程序

SpringBoot+MyBatis搭建小程序后台

91499 学习 · 621 问题

查看课程

相似问题