这个问题花了我一天的时间,真是醉了阿。还是对Spring OAuth2了解的不够。下一步好好看看Spring体系。

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jwtTokenEnhancer' defined in class path resource [org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter]: Factory method 'jwtTokenEnhancer' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [404 page not found
]at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.resolveBeanReference(ConfigurationClassEnhancer.java:362) ~[spring-context-5.3.9.jar:5.3.9]at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:334) ~[spring-context-5.3.9.jar:5.3.9]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714.jwtTokenEnhancer(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.jwtTokenStore(ResourceServerTokenServicesConfiguration.java:275) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714.CGLIB$jwtTokenStore$2(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714$$FastClassBySpringCGLIB$$d18a9ae4.invoke(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.9.jar:5.3.9]at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.9.jar:5.3.9]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714.jwtTokenStore(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_221]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_221]at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.9.jar:5.3.9]... 34 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter]: Factory method 'jwtTokenEnhancer' threw exception; nested exception is org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [404 page not found
]at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.3.9.jar:5.3.9]at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ~[spring-beans-5.3.9.jar:5.3.9]... 57 common frames omitted
Caused by: org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found: [404 page not found
]at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:113) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:186) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:125) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:819) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602) ~[spring-web-5.3.9.jar:5.3.9]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.getKeyFromServer(ResourceServerTokenServicesConfiguration.java:318) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration.jwtTokenEnhancer(ResourceServerTokenServicesConfiguration.java:283) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714.CGLIB$jwtTokenEnhancer$1(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714$$FastClassBySpringCGLIB$$d18a9ae4.invoke(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.9.jar:5.3.9]at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.9.jar:5.3.9]at org.springframework.boot.autoconfigure.security.oauth2.resource.ResourceServerTokenServicesConfiguration$JwtTokenServicesConfiguration$$EnhancerBySpringCGLIB$$9c129714.jwtTokenEnhancer(<generated>) ~[spring-security-oauth2-autoconfigure-2.1.2.RELEASE.jar:2.1.2.RELEASE]at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_221]at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_221]at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_221]at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_221]at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.9.jar:5.3.9]... 58 common frames omitted

报这个错是因为我们没有在客户端的 application-dev.yml里配置token-value


配置好之后就可以正常启动了,后面应该还会有很多坑。继续干…

SpringOAuth2-启动网关Factory method ‘jwtTokenEnhancer‘ threw exception;相关推荐

  1. Factory method ‘redisConnectionFactory‘ threw exception; nested exception is java.lang.NoClassDefFou

    Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoClassDefFou ...

  2. Factory method ‘sqlSessionFactory‘ threw exception; nested exception is java.lang.NoSuchMethodError:

    springboot 引入mybatis-plus后报错: Factory method 'sqlSessionFactory' threw exception; nested exception i ...

  3. Factory method 'springSecurityFilterChain' threw exception

    报错信息 Error starting ApplicationContext. To display the auto-configuration report re-run your applica ...

  4. Bean无法注入,‘sqlSessionFactory‘ threw exception,‘dataSource‘ threw exception大坑

    原因: 1.配置类中jdbc的配置没错. 2.controller,service,mapper层注解都有 3.启动类上面也有自动扫描的注解 @ComponentScan(basePackages = ...

  5. JAVA零碎要点008---tomcat启动的时候报错了严重: End event threw exception java.lang.reflect.InvocationTargetExcepti

    tomcat启动的时候报错了: 严重: End event threw exception java.lang.reflect.InvocationTargetException         at ...

  6. 启动报错 Bean instantiation via factory method failed

    启动报错 Bean instantiation via factory method failed 在引入 mybatis-plus 之后,启动项目总是报错 Bean instantiation vi ...

  7. HTTP Status 500 - Servlet.init() for servlet DispatcherServlet threw exception

    车祸现场一 type Exception reportmessage Servlet.init() for servlet DispatcherServlet threw exceptiondescr ...

  8. Error creating bean with name ‘processEngine‘: FactoryBean threw exception on object creation; neste

    Exception sending context initialized event to listener instance of class org.springframework.web.co ...

  9. Servlet.service() for servlet [jsp] in context with path [] threw exception [java.lang.LinkageError

    启动maven的web项目时报错: Servlet.service() for servlet [jsp] in context with path [] threw exception [java. ...

最新文章

  1. Wiz开发 定时器的使用与处理
  2. AI 世界的硬核之战,Tengine 凭什么成为最受开发者欢迎的主流框架?
  3. BCH生态建设逐步推进: Electron Cash钱包即将推出IOS版
  4. pip install jieba安装慢,安装失败,安装不解决办法
  5. mysql链接丢失_mysql 连接丢失错误解决(转载)
  6. Python 调试:pdb
  7. 华为顶尖应届生最高年薪超 200 万;抖音服务器宕机;GitLab 12.1 发布 | 极客头条...
  8. sphinx 全文检索 笔记一
  9. Linux系统环境下安装配置JDK
  10. android 视频解决方案,短视频SDK升级为短视频解决方案
  11. 如何修复计算机的无限功能,Win10系统自动修复时出现无限死循环或提示无法修复怎么办 如何禁用自动修复服务...
  12. Java8 Stream接口流式方法:map操作、filter操作以及flatMap操作
  13. Android 7.0 新特性
  14. wallpaper engine怎么用?
  15. AirTight C-65 系统启动日志
  16. html5——简易个人主页
  17. 重复文件清理软件:Umbrella for mac
  18. 借力亚马逊云科技实现 Apache APISIX 的生态探索与产品成长
  19. 【集成学习】boosting和bagging
  20. 一文看懂中国的运营商入库认证(中国电信入库指南)

热门文章

  1. Swing实现动画效果(实现Loding动画)【转载】
  2. 404 Note Found队 Alpha7
  3. 典型用户和用户场景描述
  4. errpt and errclear are unnormal
  5. linux查看当前网卡网速,Linux环境编程:获取网卡的实时网速
  6. 有道获取单词读音api
  7. 基于RTEMS的阿波罗STM32F429开发板(正点原子)适配
  8. Excel中在方框里打钩
  9. (1)语言是什么——NLP的语言基础
  10. 服务器U盘安装安装centos