栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

spring boot创建bean失败.Error creating bean with name ‘demo‘: Lookup method resolution failed

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

spring boot创建bean失败.Error creating bean with name ‘demo‘: Lookup method resolution failed

spring boot创建bean失败.

Error creating bean with name 'demo': Lookup method resolution failed

2022-05-21 23:37:44.156  WARN 8188 --- [           main] ConfigServletWebServerA
pplicationContext : Exception encountered during context initialization - cancel
ling refresh attempt: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'demo': Lookup method resolution failed; nested exc
eption is java.lang.IllegalStateException: Failed to introspect Class [com.abc.c
loud.rest.DemoRest] from ClassLoader [org.springframework.boot.loader.LaunchedUR
LClassLoader@6433a2]
2022-05-21 23:37:44.160  INFO 8188 --- [           main] o.apache.catalina.core.
StandardService   : Stopping service [Tomcat]
2022-05-21 23:37:44.219  INFO 8188 --- [           main] ConditionEvaluationRepo
rtLoggingListener :

引起这个问题的原因:

1. 可能是没有写对@RestController,@Service之类;

2. 也有可能是对应的类引用了一些类,是用引入的,在spring boot打包时,没有包含进去.然后创建bean的时候就报错.

我碰到的诡异之处在于,

在eclipse运行不报错。在dos运行就报错了。

将引入的包打进jar, 可参考:

https://blog.csdn.net/abckingaa/article/details/124914722

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/924569.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号