required a bean of type 'org.n3r.idworker.Sid' that could not be found.

required a bean of type 'org.n3r.idworker.Sid' that could not be found.

Field sid in com.imooc.service.impl.OrderServiceImpl required a bean of type 'org.n3r.idworker.Sid' that could not be found.


已增加ComponentScan注解

@ComponentScan(basePackages={"org.n3r.idworker","com.imooc.*"})


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
风间影月 2021-11-14 22:31:11

把老师的这行代码复制过去,然后记得maven clean install

  • 提问者 慕妹8372246 #1

    已在跟项目做过 Clean install
    2021-11-14 22:33:14.798  WARN 7852 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderServiceImpl': Unsatisfied dependency expressed through field 'sid'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.n3r.idworker.Sid' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


    2021-11-14 22:33:14.804  INFO 7852 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

    2021-11-14 22:35:19
  • 包名不对,或者拷贝的有问题,删了重新拷贝一下,在电脑里拷贝,不要在idea里拷贝试试
    2021-11-15 00:01:57
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师