springboot 多模块启动报错误的创建bean

项目已启动就报错误的创建bean

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shiroFilter' defined in class path resource [com/xxxxx/admin/shiro/config/ShiroConfig.class]: Unsatisfied dependency expressed through method 'shiroFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [com/xxxxxx/admin/shiro/config/ShiroConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.shiro.mgt.SecurityManager]: Factory method 'securityManager' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'loginByPasswordRealm': Unsatisfied dependency expressed through field 'getAdminService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.xxxxxx.service.GetAdminService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
   实际上一开始项目是没有问题的  然后我添加了一个模块  在创包写代码之后进行启动测试就报错误了   但是我没加这个模块的时候项目是完全没有问题的   而且新模块开发代码是没有任何问题的    但是就是启动就错误的创建bean   而且所指向的类也不对 不是我新创的模块里面的代码   .....   经过公司大佬的点播之后   看到自己新加模块所创建的包以及里面的代码与主启动类所在的位置是同级的  所以扫描不到新模块下面的加了注解的代码  需要去主启动类上添加扫描器  或者在 新创建的模块将代码所在的包放在主启动类所在的包的层级下的再下面一层就可以了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值