小工具知识网

当前位置: 首页 > 行业知识 > 启动Springcloud时,如果遇到Error creating bean with name ....时,怎么办?怎么解决?

行业知识

启动Springcloud时,如果遇到Error creating bean with name ....时,怎么办?怎么解决?

2026-11-18 04:50:17 来源:互联网转载

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonExceptionAdvice': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [co

这个错误一般是由于:扫描不到包、导包导错、注解没加或加错,类型、类名不正确等

在springcloud中的话,先看看启动类是否在三层包名之下,如果没有,则将启动类配置到三层包名之下,如:

此时再次运行即正常,如果还是不行在pom.xml 中配置

                    org.springframework.boot            spring-boot-starter-aop            3.2.1        

在springcloud中也可以这样配置:

在父pom.xml中

   org.springframework.boot   spring-boot-starter-aop   ${spring-cloud.version}

子pom.xml中引用:

      org.springframework.boot      spring-boot-starter-aop

上一篇:末日紧急服务器怎么开?

下一篇:迷你主机外接显卡怎么安装驱动教程