启动guns提示有userMapper加载不了的问题

来源:1-6 IDEA部署和导入guns

weixin_慕用7362611

2020-01-03 01:21

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbValidator': Unsatisfied dependency expressed through field 'userMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [/Users/GreenArrow/Downloads/Google Docs/guns/guns-rest/target/classes/com/stylefeng/guns/rest/common/persistence/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/spring/boot/starter/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.exceptions.MybatisPlusException: Error: GlobalConfigUtils setMetaData Fail !  Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]

at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]

at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]

以上是控制台报错

http://img1.mukewang.com/5e0e26430001219907200288.jpg这个是错误的地方,这个是Mapper:

http://img2.mukewang.com/5e0e269400014f1e08460198.jpg,我下的是gunsV3.3版本

写回答 关注

2回答

  • 慕粉3806243
    2020-10-10 20:49:36

    可能是lombok插件没有安装

  • 慕田峪7551596
    2020-03-07 19:12:28

    老弟,你的问题解决了吗?我也有这个疑问


基于SpringBoot 十分钟搞定后台管理平台

大道至简之Guns框架介绍,带你领略代码自动生成

42417 学习 · 201 问题

查看课程

相似问题