Skip to content

按照官方文档使用Spring Boot 实现Authentication Server出现无法加载bean错误,如何处理呢 #25

@qqdbwl

Description

@qqdbwl

. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
' |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v2.1.7.RELEASE)

2020-03-26 18:00:46.174 INFO 11380 --- [ main] c.g.t.a.AuthenticationServer : Starting AuthenticationServer on DESKTOP-1D22NVS with PID 11380 (D:\Solution\servicecomb\thaidee-platform\td-oauth\authentication-server\target\classes started by QQ in D:\Solution\servicecomb\thaidee-platform)
2020-03-26 18:00:46.179 INFO 11380 --- [ main] c.g.t.a.AuthenticationServer : No active profile set, falling back to default profiles: default
2020-03-26 18:00:48.508 INFO 11380 --- [ main] o.a.s.c.ConfigurationSpringInitializer : Environment received, will get configurations from [org.springframework.web.context.support.StandardServletEnvironment@842588842].
2020-03-26 18:00:48.543 WARN 11380 --- [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2020-03-26 18:00:48.543 INFO 11380 --- [ main] c.n.c.sources.URLConfigurationSource : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-03-26 18:00:48.636 INFO 11380 --- [ main] o.apache.servicecomb.config.ConfigUtil : create local config:
2020-03-26 18:00:48.653 INFO 11380 --- [ main] c.netflix.config.DynamicPropertyFactory : DynamicPropertyFactory is initialized with configuration sources: com.netflix.config.ConcurrentCompositeConfiguration@7126e26
2020-03-26 18:00:48.672 INFO 11380 --- [ main] o.apache.servicecomb.config.ConfigUtil : jar:file:/C:/Users/QQ/.m2/repository/org/apache/servicecomb/java-chassis-core/2.0.0/java-chassis-core-2.0.0.jar!/microservice.yaml,file:/D:/Solution/servicecomb/test-platform/td-oauth/authentication-server/target/classes/microservice.yaml.
2020-03-26 18:00:48.693 INFO 11380 --- [ main] o.a.s.f.common.utils.SPIServiceUtils : Found SPI service org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource, count=0.
2020-03-26 18:00:48.693 INFO 11380 --- [ main] o.a.s.f.common.utils.SPIServiceUtils : Can not find SPI service for org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource
2020-03-26 18:00:48.693 INFO 11380 --- [ main] o.apache.servicecomb.config.ConfigUtil : config center SPI service can not find, skip to load configuration from config center
2020-03-26 18:00:48.697 INFO 11380 --- [ main] o.a.s.f.common.utils.SPIServiceUtils : Can not find SPI service for org.apache.servicecomb.config.spi.ConfigCenterConfigurationSource
2020-03-26 18:00:48.701 INFO 11380 --- [ main] o.apache.servicecomb.config.ConfigUtil : create local config:
2020-03-26 18:00:48.701 INFO 11380 --- [ main] o.apache.servicecomb.config.ConfigUtil : jar:file:/C:/Users/QQ/.m2/repository/org/apache/servicecomb/java-chassis-core/2.0.0/java-chassis-core-2.0.0.jar!/microservice.yaml,file:/D:/Solution/servicecomb/test-platform/td-oauth/authentication-server/target/classes/microservice.yaml.
2020-03-26 18:00:48.825 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSource' of type [org.apache.commons.dbcp2.BasicDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:49.036 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.mybatis.spring.SqlSessionFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:49.036 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'sqlSessionFactory' of type [org.apache.ibatis.session.defaults.DefaultSqlSessionFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:49.042 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'userMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:49.044 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'tokenMapper' of type [org.mybatis.spring.mapper.MapperFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:49.114 INFO 11380 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$88187c78] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-26 18:00:50.011 INFO 11380 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 10008 (http)
2020-03-26 18:00:50.060 INFO 11380 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-03-26 18:00:50.060 INFO 11380 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.22]
2020-03-26 18:00:50.202 INFO 11380 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-03-26 18:00:50.203 INFO 11380 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3948 ms
2020-03-26 18:00:50.608 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : add network interface name:eth6,host address:10.65.0.131
2020-03-26 18:00:50.621 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : add network interface name:eth7,host address:10.65.0.49
2020-03-26 18:00:50.648 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : add network interface name:eth13,host address:172.17.80.193
2020-03-26 18:00:50.690 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : add network interface name:eth26,host address:172.18.80.1
2020-03-26 18:00:50.718 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : get localhost address: 10.65.0.131
2020-03-26 18:00:50.718 INFO 11380 --- [ main] o.a.s.foundation.common.net.NetUtils : add host name from localhost:DESKTOP-1D22NVS,host address:10.65.0.131
2020-03-26 18:00:50.720 INFO 11380 --- [ main] o.a.s.t.rest.servlet.ServletUtils : /0.0.0.0:9061 is not listened, can not publish.
2020-03-26 18:00:50.720 WARN 11380 --- [ main] o.a.s.t.r.servlet.RestServletInjector : ignore register ServicecombRestServlet.
2020-03-26 18:00:50.722 INFO 11380 --- [ main] o.a.s.t.rest.servlet.ServletUtils : RestServlet not found, will not save UrlPrefix.
2020-03-26 18:00:50.724 INFO 11380 --- [ main] o.a.s.common.rest.UploadConfig : servicecomb.uploads.directory is null, not support upload.
2020-03-26 18:00:50.790 WARN 11380 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authOpenIDTokenStore': Unsatisfied dependency expressed through field 'accessTokenStore'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.my.test.authentication.token.TokenStore<com.my.test.authentication.token.SessionToken>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=authAccessTokenStore)}
2020-03-26 18:00:50.795 INFO 11380 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-03-26 18:00:50.811 INFO 11380 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-26 18:00:50.997 ERROR 11380 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field accessTokenStore in com.my.test.authentication.token.AbstractOpenIDTokenStore required a bean of type 'com.my.test.authentication.token.TokenStore' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Qualifier(value=authAccessTokenStore)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions