问答详情
源自:1-5 快速入门小例子

用的idea检查了好几遍

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [C:\Genius\IdeaProjects\spring\target\classes\com\wisdom\dao\UserMapper.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/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: Error: GlobalConfigUtils setMetaData Fail !  Cause:java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1515)


提问者:itmk 2019-09-18 21:58

个回答

  • itmk
    2019-09-19 09:22:20

    昨天晚上,启动类配置了包扫描,确定配置了,跟着你的快速入门小例子写的,yml只配置了数据库模块.
    今天换了一台电脑,我重新写了一遍,竟然可以了,目前还没有发现具体原因

  • 慕虎02294
    2019-09-18 23:50:05

    spring boot启动类没有配置包扫描

    或者yml中没有.xml扫描