Spring 所有的Bean创建失败

本来心态好好的在写代码,测试了一小小下,措不及防给我来这么下
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘studentServiceImpl’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘MStudentMapper’ defined in file [E:\桌面\springboot_pro\demo2\target\classes\com\example\demo2\mapper\MStudentMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration’: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mybatisPlusInterceptor’ defined in class path resource [com/example/demo2/config/MybatisPlusConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor]: Factory method ‘mybatisPlusInterceptor’ threw exception; nested exception is java.lang.NoClassDefFoundError: net/sf/jsqlparser/statement/select/SelectExpressionItem
几乎所有的bean都报错,完全找不到头绪,看了其他人问题解答,说是要加入druid的连接池依赖

 <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.2.20</version>
        </dependency>

但我加了也没有用,之前没加也可以啊,然后发现我的配置文件可能是项目加载问题,idea时常抽风,没有加载上(就是没有变spring绿叶),又手动配置了下,
在这里插入图片描述
也不行,service层、controller层、config文件都加了注解,还有启动类也加了mapper路径,还是毫无头绪。
我当时在做mybatisplus分页插件,我就把刚写的配置类给删除了,从新编译,发现项目可以启动,
在这里插入图片描述
当我又加上,发现果然又报错,思考了下,可能是因为我mapper路径下的studen采用的是用mybatis写的,可能两者有冲突导致的

  • 11
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值