apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.23k stars 8.76k forks source link

io.seata.common.exception.ShouldNeverHappenException: Auto proxy of DataSource can't be enabled as you've created a DataSourceProxy bean.Please consider removing DataSourceProxy bean or disabling auto proxy of DataSource. #2469

Closed micyo202 closed 4 years ago

micyo202 commented 4 years ago

Ⅰ. Issue Description

seata-server 正常启动 应用服务启动数据源代理配置报错

Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

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

2020-03-28 13:53:58.877  INFO 49862 --- [           main] c.l.d.consumer.ConsumerDemoApplication   : No active profile set, falling back to default profiles: default
2020-03-28 13:53:59.597  INFO 49862 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=d8ed3559-4e8a-3f94-bc43-dada2a39cad5
2020-03-28 13:53:59.673  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.alibaba.seata-io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration' of type [io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.674  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'seataProperties' of type [io.seata.spring.boot.autoconfigure.properties.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.675  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration$$EnhancerBySpringCGLIB$$b91670b1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.682  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'springUtils' of type [io.seata.spring.boot.autoconfigure.util.SpringUtils] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.682  INFO 49862 --- [           main] i.s.s.b.a.SeataAutoConfiguration         : Automatically configure Seata
2020-03-28 13:53:59.725  INFO 49862 --- [           main] io.seata.config.FileConfiguration        : The file name of the operation is registry.conf
2020-03-28 13:53:59.760  INFO 49862 --- [           main] i.s.common.loader.EnhancedServiceLoader  : load ExtConfigurationProvider[null] extension by class[io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider]
2020-03-28 13:53:59.768  INFO 49862 --- [           main] io.seata.config.ConfigurationFactory     : load extConfiguration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2020-03-28 13:53:59.771  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configProperties' of type [io.seata.spring.boot.autoconfigure.properties.registry.ConfigProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.774  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configFileProperties' of type [io.seata.spring.boot.autoconfigure.properties.registry.ConfigFileProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.774  INFO 49862 --- [           main] io.seata.config.FileConfiguration        : The file name of the operation is file.conf
2020-03-28 13:53:59.777  INFO 49862 --- [           main] io.seata.config.ConfigurationFactory     : load extConfiguration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2020-03-28 13:53:59.779  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'serviceProperties' of type [io.seata.spring.boot.autoconfigure.properties.file.ServiceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.781  INFO 49862 --- [           main] i.s.s.a.GlobalTransactionScanner         : Initializing Global Transaction Clients ... 
2020-03-28 13:53:59.796  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'transportProperties' of type [io.seata.spring.boot.autoconfigure.properties.file.TransportProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.912  INFO 49862 --- [           main] i.s.c.r.netty.AbstractRpcRemotingClient  : RpcClientBootstrap has started
2020-03-28 13:53:59.913  INFO 49862 --- [           main] i.s.s.a.GlobalTransactionScanner         : Transaction Manager Client is initialized. applicationId[demo-consumer] txServiceGroup[my_test_tx_group]
2020-03-28 13:53:59.923  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'clientProperties' of type [io.seata.spring.boot.autoconfigure.properties.file.ClientProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.923  INFO 49862 --- [           main] io.seata.rm.datasource.AsyncWorker       : Async Commit Buffer Limit: 10000
2020-03-28 13:53:59.927  INFO 49862 --- [           main] i.s.c.r.netty.AbstractRpcRemotingClient  : RpcClientBootstrap has started
2020-03-28 13:53:59.928  INFO 49862 --- [           main] i.s.s.a.GlobalTransactionScanner         : Resource Manager is initialized. applicationId[demo-consumer] txServiceGroup[my_test_tx_group]
2020-03-28 13:53:59.928  INFO 49862 --- [           main] i.s.s.a.GlobalTransactionScanner         : Global Transaction Clients are initialized. 
2020-03-28 13:53:59.953  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration$FeignBeanPostProcessorConfiguration' of type [com.alibaba.cloud.seata.feign.SeataFeignClientAutoConfiguration$FeignBeanPostProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:53:59.958  INFO 49862 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'seataFeignObjectWrapper' of type [com.alibaba.cloud.seata.feign.SeataFeignObjectWrapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-03-28 13:54:00.175  INFO 49862 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8701 (http)
2020-03-28 13:54:00.188  INFO 49862 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-03-28 13:54:00.189  INFO 49862 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.31]
2020-03-28 13:54:00.298  INFO 49862 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-03-28 13:54:00.298  INFO 49862 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1398 ms
2020-03-28 13:54:00.413  INFO 49862 --- [           main] i.s.s.a.GlobalTransactionScanner         : Auto proxy of [druidDataSource]
2020-03-28 13:54:00.457  INFO 49862 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited
2020-03-28 13:54:00.860  INFO 49862 --- [           main] i.s.c.r.netty.NettyClientChannelManager  : will connect to 127.0.0.1:8091
2020-03-28 13:54:00.861  INFO 49862 --- [           main] io.seata.core.rpc.netty.RmRpcClient      : RM will register :jdbc:mysql://localhost:3306/test
2020-03-28 13:54:00.864  INFO 49862 --- [           main] i.s.core.rpc.netty.NettyPoolableFactory  : NettyPool create channel to transactionRole:RMROLE,address:127.0.0.1:8091,msg:< RegisterRMRequest{resourceIds='jdbc:mysql://localhost:3306/test', applicationId='demo-consumer', transactionServiceGroup='my_test_tx_group'} >
2020-03-28 13:54:01.054  INFO 49862 --- [lector_RMROLE_1] i.s.common.loader.EnhancedServiceLoader  : load Codec[SEATA] extension by class[io.seata.codec.seata.SeataCodec]
2020-03-28 13:54:01.141  INFO 49862 --- [           main] io.seata.core.rpc.netty.RmRpcClient      : register RM success. server version:1.0.0,channel:[id: 0xa4e23d43, L:/127.0.0.1:60071 - R:/127.0.0.1:8091]
2020-03-28 13:54:01.148  INFO 49862 --- [           main] i.s.core.rpc.netty.NettyPoolableFactory  : register success, cost 131 ms, version:1.0.0,role:RMROLE,channel:[id: 0xa4e23d43, L:/127.0.0.1:60071 - R:/127.0.0.1:8091]
2020-03-28 13:54:01.157  INFO 49862 --- [           main] io.seata.core.rpc.netty.RmRpcClient      : will register resourceId:jdbc:mysql://localhost:3306/test
2020-03-28 13:54:01.159  WARN 49862 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceProxy' defined in class path resource [com/demo/consumer/config/DataSourceProxyConfig.class]: Initialization of bean failed; nested exception is io.seata.common.exception.ShouldNeverHappenException: Auto proxy of DataSource can't be enabled as you've created a DataSourceProxy bean.Please consider removing DataSourceProxy bean or disabling auto proxy of DataSource.
2020-03-28 13:54:01.159  INFO 49862 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...
2020-03-28 13:54:01.167  INFO 49862 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed
2020-03-28 13:54:01.169  INFO 49862 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-03-28 13:54:01.182  INFO 49862 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-28 13:54:01.197 ERROR 49862 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceProxy' defined in class path resource [com/demo/consumer/config/DataSourceProxyConfig.class]: Initialization of bean failed; nested exception is io.seata.common.exception.ShouldNeverHappenException: Auto proxy of DataSource can't be enabled as you've created a DataSourceProxy bean.Please consider removing DataSourceProxy bean or disabling auto proxy of DataSource.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
    at com.demo.consumer.ConsumerDemoApplication.main(ConsumerDemoApplication.java:26) ~[main/:na]
Caused by: io.seata.common.exception.ShouldNeverHappenException: Auto proxy of DataSource can't be enabled as you've created a DataSourceProxy bean.Please consider removing DataSourceProxy bean or disabling auto proxy of DataSource.
    at io.seata.spring.annotation.GlobalTransactionScanner.postProcessBeforeInitialization(GlobalTransactionScanner.java:314) ~[seata-all-1.0.0.jar:1.0.0]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
    ... 15 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:60051', transport: 'socket'

Process finished with exit code 1

补充 seata-server 日志

Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file /Users/apple/Documents/software/seata-server-1.0.0/logs/seata_gc.log due to No such file or directory

13:53:34,830 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
13:53:34,830 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
13:53:34,830 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/apple/Documents/software/seata-server-1.0.0/conf/logback.xml]
13:53:34,831 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
13:53:34,831 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/apple/Documents/software/seata-server-1.0.0/conf/logback.xml]
13:53:34,831 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [jar:file:/Users/apple/Documents/software/seata-server-1.0.0/lib/seata-server-1.0.0.jar!/logback.xml]
13:53:34,908 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
13:53:34,913 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Will scan for changes in [file:/Users/apple/Documents/software/seata-server-1.0.0/conf/logback.xml] 
13:53:34,913 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeTask scanning period to 1 minutes
13:53:34,916 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:53:34,919 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [stdout]
13:53:34,977 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
13:53:34,980 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [seata-default]
13:53:34,988 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1418428263 - Archive files will be limited to [2048 MB] each.
13:53:34,992 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1418428263 - No compression will be used
13:53:34,993 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1418428263 - Will use the pattern /Users/apple/logs/seata/seata-server.log.%d{yyyy-MM-dd}.%i for the active file
13:53:34,995 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7ac7a4e4 - The date pattern is 'yyyy-MM-dd' from file name pattern '/Users/apple/logs/seata/seata-server.log.%d{yyyy-MM-dd}.%i'.
13:53:34,995 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7ac7a4e4 - Roll-over at midnight.
13:53:34,997 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@7ac7a4e4 - Setting initial period to Sat Mar 28 13:19:07 CST 2020
13:53:35,000 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@1418428263 - Cleaning on start up
13:53:35,000 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - first clean up after appender initialization
13:53:35,001 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:53:35,003 |-INFO in c.q.l.core.rolling.helper.TimeBasedArchiveRemover - Multiple periods, i.e. 32 periods, seem to have elapsed. This is expected at application start.
13:53:35,004 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[seata-default] - Active log file name: /Users/apple/logs/seata/seata-server.log
13:53:35,004 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[seata-default] - File property is set to [/Users/apple/logs/seata/seata-server.log]
13:53:35,005 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [io.seata.server.store.file.FileTransactionStoreManager] to false
13:53:35,005 |-INFO in ch.qos.logback.classic.joran.action.LevelAction - io.seata.server.store.file.FileTransactionStoreManager level set to INFO
13:53:35,005 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [seata-default] to Logger[io.seata.server.store.file.FileTransactionStoreManager]
13:53:35,006 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
13:53:35,006 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [seata-default] to Logger[ROOT]
13:53:35,006 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [stdout] to Logger[ROOT]
13:53:35,006 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:53:35,006 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@6d78f375 - Registering current configuration as safe fallback point

2020-03-28 13:53:35.054 INFO [main]io.seata.config.FileConfiguration.<init>:101 -The file name of the operation is registry.conf
2020-03-28 13:53:35.123 WARN [main]io.seata.config.ConfigurationFactory.<clinit>:68 -failed to load extConfiguration:not found service provider for : io.seata.config.ExtConfigurationProvider[null] and classloader : sun.misc.Launcher$AppClassLoader@37a71e93
io.seata.common.loader.EnhancedServiceNotFoundException: not found service provider for : io.seata.config.ExtConfigurationProvider[null] and classloader : sun.misc.Launcher$AppClassLoader@37a71e93
2020-03-28 13:53:35.137 INFO [main]io.seata.config.FileConfiguration.<init>:101 -The file name of the operation is file.conf
2020-03-28 13:53:35.140 WARN [main]io.seata.config.ConfigurationFactory.buildConfiguration:118 -failed to load extConfiguration:not found service provider for : io.seata.config.ExtConfigurationProvider[null] and classloader : sun.misc.Launcher$AppClassLoader@37a71e93
io.seata.common.loader.EnhancedServiceNotFoundException: not found service provider for : io.seata.config.ExtConfigurationProvider[null] and classloader : sun.misc.Launcher$AppClassLoader@37a71e93
2020-03-28 13:53:35.142 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property metrics.enabled, try to use default value instead.
2020-03-28 13:53:35.153 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.boss-thread-prefix, try to use default value instead.
2020-03-28 13:53:35.154 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.worker-thread-prefix, try to use default value instead.
2020-03-28 13:53:35.154 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.share-boss-worker, try to use default value instead.
2020-03-28 13:53:35.155 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.type, try to use default value instead.
2020-03-28 13:53:35.156 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.worker-thread-size, try to use default value instead.
2020-03-28 13:53:35.163 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.server, try to use default value instead.
2020-03-28 13:53:35.177 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.heartbeat, try to use default value instead.
2020-03-28 13:53:35.251 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.boss-thread-size, try to use default value instead.
2020-03-28 13:53:35.251 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.boss-thread-prefix, try to use default value instead.
2020-03-28 13:53:35.252 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.boss-thread-size, try to use default value instead.
2020-03-28 13:53:35.292 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.thread-factory.worker-thread-prefix, try to use default value instead.
2020-03-28 13:53:35.305 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.file.session.reload.read_size, try to use default value instead.
2020-03-28 13:53:35.313 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.file.file-write-buffer-cache-size, try to use default value instead.
2020-03-28 13:53:35.314 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.file.flush-disk-mode, try to use default value instead.
2020-03-28 13:53:35.315 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.query-limit, try to use default value instead.
2020-03-28 13:53:35.319 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load DataSourceGenerator[dbcp] extension by class[io.seata.server.store.db.DbcpDataSourceGenerator]
2020-03-28 13:53:35.396 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:35.397 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.max-conn, try to use default value instead.
2020-03-28 13:53:35.397 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:35.397 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:35.401 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.global.table, try to use default value instead.
2020-03-28 13:53:35.402 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.branch.table, try to use default value instead.
2020-03-28 13:53:36.399 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load LogStore[DB] extension by class[io.seata.core.store.db.LogStoreDataBaseDAO]
2020-03-28 13:53:36.400 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load TransactionStoreManager[DB] extension by class[io.seata.server.store.db.DatabaseTransactionStoreManager]
2020-03-28 13:53:36.400 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load SessionManager[DB] extension by class[io.seata.server.session.db.DataBaseSessionManager]
2020-03-28 13:53:36.401 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.query-limit, try to use default value instead.
2020-03-28 13:53:36.403 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:36.403 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.max-conn, try to use default value instead.
2020-03-28 13:53:36.404 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:36.404 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:36.405 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.global.table, try to use default value instead.
2020-03-28 13:53:36.405 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.branch.table, try to use default value instead.
2020-03-28 13:53:37.013 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.query-limit, try to use default value instead.
2020-03-28 13:53:37.016 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.016 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.max-conn, try to use default value instead.
2020-03-28 13:53:37.016 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.017 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.018 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.global.table, try to use default value instead.
2020-03-28 13:53:37.018 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.branch.table, try to use default value instead.
2020-03-28 13:53:37.627 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.query-limit, try to use default value instead.
2020-03-28 13:53:37.629 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.629 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.max-conn, try to use default value instead.
2020-03-28 13:53:37.630 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.630 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.min-conn, try to use default value instead.
2020-03-28 13:53:37.631 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.global.table, try to use default value instead.
2020-03-28 13:53:37.632 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property store.db.branch.table, try to use default value instead.
2020-03-28 13:53:38.525 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.recovery.committing-retry-period, try to use default value instead.
2020-03-28 13:53:38.525 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.recovery.asyn-committing-retry-period, try to use default value instead.
2020-03-28 13:53:38.525 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.recovery.rollbacking-retry-period, try to use default value instead.
2020-03-28 13:53:38.526 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.recovery.timeout-retry-period, try to use default value instead.
2020-03-28 13:53:38.526 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.undo.log.delete.period, try to use default value instead.
2020-03-28 13:53:38.528 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.max.commit.retry.timeout, try to use default value instead.
2020-03-28 13:53:38.528 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property server.max.rollback.retry.timeout, try to use default value instead.
2020-03-28 13:53:38.722 INFO [main]io.seata.core.rpc.netty.AbstractRpcRemotingServer.start:155 -Server started ... 
2020-03-28 13:53:38.731 INFO [main]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load RegistryProvider[Nacos] extension by class[io.seata.discovery.registry.nacos.NacosRegistryProvider]
2020-03-28 13:54:01.102 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.serialization, try to use default value instead.
2020-03-28 13:54:01.103 WARN [configOperate_2_2]io.seata.config.FileConfiguration.run:266 -Could not found property transport.compressor, try to use default value instead.
2020-03-28 13:54:01.111 INFO [NettyServerNIOWorker_1_16]io.seata.common.loader.EnhancedServiceLoader.loadFile:236 -load Codec[SEATA] extension by class[io.seata.codec.seata.SeataCodec]
2020-03-28 13:54:01.123 INFO [ServerHandlerThread_1_500]io.seata.core.rpc.DefaultServerMessageListenerImpl.onRegRmMessage:123 -rm register success,message:RegisterRMRequest{resourceIds='jdbc:mysql://localhost:3306/test', applicationId='demo-consumer', transactionServiceGroup='my_test_tx_group'},channel:[id: 0x78f56682, L:/127.0.0.1:8091 - R:/127.0.0.1:60071]
2020-03-28 13:54:01.158 INFO [ServerHandlerThread_1_500]io.seata.core.rpc.DefaultServerMessageListenerImpl.onRegRmMessage:123 -rm register success,message:RegisterRMRequest{resourceIds='jdbc:mysql://localhost:3306/test', applicationId='demo-consumer', transactionServiceGroup='my_test_tx_group'},channel:[id: 0x78f56682, L:/127.0.0.1:8091 - R:/127.0.0.1:60071]
2020-03-28 13:54:01.579 INFO [NettyServerNIOWorker_1_16]io.seata.core.rpc.netty.RpcServer.handleDisconnect:329 -127.0.0.1:60071 to server channel inactive.
2020-03-28 13:54:01.579 INFO [NettyServerNIOWorker_1_16]io.seata.core.rpc.netty.RpcServer.handleDisconnect:334 -remove channel:[id: 0x78f56682, L:/127.0.0.1:8091 ! R:/127.0.0.1:60071]context:RpcContext{applicationId='demo-consumer', transactionServiceGroup='my_test_tx_group', clientId='demo-consumer:127.0.0.1:60071', channel=[id: 0x78f56682, L:/127.0.0.1:8091 ! R:/127.0.0.1:60071], resourceSets=[]}

Ⅲ. Describe what you expected to happen

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. xxx
  2. xxx
  3. xxx

Ⅴ. Anything else we need to know?

已经在seata -> file.conf配置service{}下添加如下内容

disableGlobalTransaction = false

build.gradle 依赖

implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
implementation 'com.alibaba.cloud:spring-cloud-starter-alibaba-seata'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
runtimeOnly 'mysql:mysql-connector-java'
implementation "com.alibaba:druid-spring-boot-starter:${druidVersion}"
implementation "com.baomidou:mybatis-plus-boot-starter:${mybatisPlusVersion}"

DataSourceProxyConfig配置类

    @Bean
    @ConfigurationProperties(prefix = "spring.datasource.druid")
    public DataSource druidDataSource() {
        DruidDataSource druidDataSource = new DruidDataSource();
        return druidDataSource;
    }
    @Primary
    @Bean("dataSource")
    public DataSourceProxy dataSourceProxy(DataSource druidDataSource) {
        return new DataSourceProxy(druidDataSource);
    }
    @Bean(name = "sqlSessionFactory")
    public SqlSessionFactory sqlSessionFactoryBean(DataSourceProxy dataSourceProxy) throws Exception {
        MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
        bean.setDataSource(dataSourceProxy);
        ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
        bean.setMapperLocations(resolver.getResources("classpath*:mapper/**/*.xml"));

        SqlSessionFactory factory = null;
        try {
            factory = bean.getObject();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return factory;
    }
    @Bean
    public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
        return new SqlSessionTemplate(sqlSessionFactory);
    }

Ⅵ. Environment:

lomofu commented 4 years ago

这个问题我使用了 druid连接池就好了 我原来使用的是hikari 也是出现这个错误 然后将seata版本尝试调整到1.1.0 希望对你有帮助

funky-eyes commented 4 years ago

image

micyo202 commented 4 years ago

感谢https://github.com/seata/seata/issues/2469#issuecomment-605798304提供的方法,该问题已解决 需要查看基于spring cloud+nacos+sentinel+seata+feign+druid+mybatis-plus的完整示例项目,可参考https://github.com/micyo202/lion