seata : 注解报错 Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]:

2019-12-04 21:42:13.837  INFO 29280 --- [           main] com.itheima.OrderApplication             : No active profile set, falling back to default profiles: default
2019-12-04 21:42:14.983  WARN 29280 --- [           main] t.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.itheima]' package. Please check your configuration.
2019-12-04 21:42:14.999  WARN 29280 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.itheima]' package. Please check your configuration.
2019-12-04 21:42:15.349  INFO 29280 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-12-04 21:42:15.354  INFO 29280 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-12-04 21:42:15.426  INFO 29280 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 40ms. Found 0 repository interfaces.
2019-12-04 21:42:15.657  WARN 29280 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2019-12-04 21:42:15.999  INFO 29280 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=90232c00-a7b2-3b5d-bdaa-f3bf340b5558
2019-12-04 21:42:16.028  INFO 29280 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.itheima.feign.ItemInfoFeign' of type [org.springframework.cloud.openfeign.FeignClientFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-04 21:42:16.030  INFO 29280 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.itheima.feign.OrderInfoFeign' of type [org.springframework.cloud.openfeign.FeignClientFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-04 21:42:16.032  INFO 29280 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.itheima.feign.UserInfoFeign' of type [org.springframework.cloud.openfeign.FeignClientFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-04 21:42:16.095  INFO 29280 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.alibaba.seata-com.alibaba.cloud.seata.SeataProperties' of type [com.alibaba.cloud.seata.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-04 21:42:16.096  INFO 29280 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration' of type [com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$c597bf41] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-12-04 21:42:16.231  WARN 29280 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property config.type, try to use default value instead.
2019-12-04 21:42:16.234  WARN 29280 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalTransactionScanner' defined in class path resource [com/alibaba/cloud/seata/GlobalTransactionAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is io.seata.common.exception.NotSupportYetException: not support register type: null
2019-12-04 21:42:16.250  INFO 29280 --- [           main] ConditionEvaluationReportLoggingListener : 

    引入依赖错误导致:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-12-04 22:02:22.694 ERROR 10460 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalTransactionScanner' defined in class path resource [com/alibaba/cloud/seata/GlobalTransactionAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is io.seata.common.exception.NotSupportYetException: not support register type: null
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.9.RELEASE.jar:5.1.9.RELEASE]

 bug  2 :

        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:10.195  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:10.195 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:10.218  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:10.218 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:15.195  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:15.195 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:15.220  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:15.220 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:20.196  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.
2019-12-04 22:34:20.196 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:20.220 ERROR 7012 --- [imeoutChecker_1] i.s.c.r.netty.NettyClientChannelManager  : no available server to connect.
2019-12-04 22:34:20.220  WARN 7012 --- [nfigOperate_1_2] io.seata.config.FileConfiguration        : Could not found property service.vgroup_mapping.business-fescar-service-group, try to use default value instead.

原因是:

server:
  port: 18081
spring:
  application:
    name: business
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.211.132:3306/fescar_business?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
    username: root
    password: 123456
  main:
    allow-bean-definition-overriding: true
  #配置分布式事务组
  cloud:
    alibaba:
      seata:
        tx-service-group: my_test_tx_group
eureka:
  client:
    service-url:
      defaultZone: http://127.0.0.1:7001/eureka
  instance:
    prefer-ip-address: true
feign:
  hystrix:
    enabled: true

#读取超时设置
ribbon:
  ReadTimeout: 30000
#hystrix 配置
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000
          strategy: SEMAPHORE

 #配置分布式事务组  要在  spring  下
  cloud:
    alibaba:
      seata:
        tx-service-group: my_test_tx_group   

发布了221 篇原创文章 · 获赞 8 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/oDianZi1234567/article/details/103395179