seta如何使用db模式

Blade 已结 1 644
E-ER
E-ER 剑圣 2021-11-04 10:54

一、该问题的重现步骤是什么?

增加了启动模式:db,但是在运行时报错不支持db,关于网络上的一些资料也没有看的太明白。db,file,nacos模式的区别是什么,找了几篇文章也没有详细说明,只是说了以什么形式存储事务日志和事务执行信息。

1. image.png

2. image.png

3.


二、你期待的结果是什么?实际看到的又是什么?

如何使用db模式,数据库脚本已经执行

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

baldex 2.8.2 windows/linux

四、请供详细的错误堆栈信息,这很重要。

D:\WORK\Tool\Java\jdk1.8.0_191\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:D:\WORK\Tool\IntelliJ IDEA 2021.1.2\lib\idea_rt.jar=63371:D:\WORK\Tool\IntelliJ IDEA 2021.1.2\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath C:\Users\admin\AppData\Local\Temp\classpath510726399.jar com.eer.ep.EpApplication

----启动中,读取到的环境变量:[dev],jar地址:[]----

2021-11-04 10:24:49.315  INFO [eer-ep,,,] 25744 --- [kground-preinit] o.h.validator.internal.util.Version      : HV000001: Hibernate Validator 6.1.7.Final

                  .----------------.  .----------------.  .----------------.

                 | .--------------. || .--------------. || .--------------. |

                 | |  _________   | || |  _________   | || |  _______     | |

                 | | |_   ___  |  | || | |_   ___  |  | || | |_   __ \    | |

                 | |   | |_  \_|  | || |   | |_  \_|  | || |   | |__) |   | |

                 | |   |  _|  _   | || |   |  _|  _   | || |   |  __ /    | |

                 | |  _| |___/ |  | || |  _| |___/ |  | || |  _| |  \ \_  | |

                 | | |_________|  | || | |_________|  | || | |____| |___| | |

                 | |              | || |              | || |              | |

                 | '--------------' || '--------------' || '--------------' |

                  '----------------'  '----------------'  '----------------'



:: EER 2.8.2.RELEASE :: eer-ep:dev :: Running SpringBoot 2.3.12.RELEASE :: 


2021-11-04 10:24:50.513  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 25 ms to scan 1 urls, producing 3 keys and 6 values 

2021-11-04 10:24:50.537  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 10 ms to scan 1 urls, producing 4 keys and 9 values 

2021-11-04 10:24:50.549  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 9 ms to scan 1 urls, producing 3 keys and 10 values 

2021-11-04 10:24:50.566  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 14 ms to scan 14 urls, producing 0 keys and 0 values 

2021-11-04 10:24:50.576  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 10 ms to scan 1 urls, producing 1 keys and 5 values 

2021-11-04 10:24:50.587  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 9 ms to scan 1 urls, producing 1 keys and 7 values 

2021-11-04 10:24:50.599  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 9 ms to scan 1 urls, producing 2 keys and 8 values 

2021-11-04 10:24:50.614  INFO [eer-ep,,,] 25744 --- [           main] org.reflections.Reflections              : Reflections took 12 ms to scan 14 urls, producing 0 keys and 0 values 

2021-11-04 10:24:52.209  WARN [eer-ep,,,] 25744 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[eer-ep] & group[DEFAULT_GROUP]

2021-11-04 10:24:52.215  WARN [eer-ep,,,] 25744 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[eer-ep.yaml] & group[DEFAULT_GROUP]

2021-11-04 10:24:52.221  WARN [eer-ep,,,] 25744 --- [           main] c.a.c.n.c.NacosPropertySourceBuilder     : Ignore the empty nacos configuration and get it based on dataId[eer-ep-dev.yaml] & group[DEFAULT_GROUP]

2021-11-04 10:24:52.222  INFO [eer-ep,,,] 25744 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-eer-ep-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-eer-ep.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-eer-ep,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-eer-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-eer.yaml,DEFAULT_GROUP'}]

2021-11-04 10:24:52.238  INFO [eer-ep,,,] 25744 --- [           main] com.eer.ep.EpApplication                 : The following profiles are active: dev

2021-11-04 10:24:52.377  WARN [eer-ep,,,] 25744 --- [           main] o.s.c.c.u.SpringFactoryImportSelector    : More than one implementation of @EnableCircuitBreaker (now relying on @Conditionals to pick one): [org.springframework.cloud.netflix.hystrix.HystrixCircuitBreakerConfiguration, com.alibaba.cloud.sentinel.custom.SentinelCircuitBreakerConfiguration]

2021-11-04 10:24:53.996  INFO [eer-ep,,,] 25744 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!

2021-11-04 10:24:53.998  INFO [eer-ep,,,] 25744 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.

2021-11-04 10:24:54.019  INFO [eer-ep,,,] 25744 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 11ms. Found 0 Redis repository interfaces.

2021-11-04 10:24:54.090  WARN [eer-ep,,,] 25744 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.

2021-11-04 10:24:54.155  WARN [eer-ep,,,] 25744 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'hystrix.stream' contains invalid characters, please migrate to a valid format.

2021-11-04 10:24:54.269  WARN [eer-ep,,,] 25744 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[com.eer.ep]' package. Please check your configuration.

2021-11-04 10:24:54.363  INFO [eer-ep,,,] 25744 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=cb847bc1-a0be-33bb-9367-e096414f5fd7

2021-11-04 10:24:54.373  INFO [eer-ep,,,] 25744 --- [           main] e.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor init.

2021-11-04 10:24:54.373  INFO [eer-ep,,,] 25744 --- [           main] e.c.l.p.BladePropertySourcePostProcessor : BladePropertySourcePostProcessor process @BladePropertySource bean.

2021-11-04 10:24:54.558  INFO [eer-ep,,,] 25744 --- [           main] i.s.s.b.a.SeataAutoConfiguration         : Automatically configure Seata

2021-11-04 10:24:54.562  INFO [eer-ep,,,] 25744 --- [           main] io.seata.config.FileConfiguration        : The file name of the operation is registry

2021-11-04 10:24:54.609  INFO [eer-ep,,,] 25744 --- [           main] io.seata.config.ConfigurationFactory     : load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb

2021-11-04 10:24:54.618  WARN [eer-ep,,,] 25744 --- [           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 [io/seata/spring/boot/autoconfigure/SeataAutoConfiguration.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 java.lang.IllegalArgumentException: not support config type: db

2021-11-04 10:24:54.632  INFO [eer-ep,,,] 25744 --- [           main] ConditionEvaluationReportLoggingListener : 


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-11-04 10:24:54.667 ERROR [eer-ep,,,] 25744 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'globalTransactionScanner' defined in class path resource [io/seata/spring/boot/autoconfigure/SeataAutoConfiguration.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 java.lang.IllegalArgumentException: not support config type: db

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:637)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1341)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1181)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)

at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:229)

at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:723)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)

at com.eer.core.launch.BladeApplication.run(BladeApplication.java:50)

at com.eer.ep.EpApplication.main(EpApplication.java:36)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.seata.spring.annotation.GlobalTransactionScanner]: Factory method 'globalTransactionScanner' threw exception; nested exception is java.lang.IllegalArgumentException: not support config type: db

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652)

... 20 common frames omitted

Caused by: java.lang.IllegalArgumentException: not support config type: db

at io.seata.config.ConfigType.getType(ConfigType.java:69)

at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:109)

at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:94)

at io.seata.spring.annotation.GlobalTransactionScanner.<init>(GlobalTransactionScanner.java:87)

at io.seata.spring.annotation.GlobalTransactionScanner.<init>(GlobalTransactionScanner.java:143)

at io.seata.spring.boot.autoconfigure.SeataAutoConfiguration.globalTransactionScanner(SeataAutoConfiguration.java:55)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)

... 21 common frames omitted



Process finished with exit code 1

五、若有更多详细信息,请在下面提供。

1条回答
  •  admin
    admin (最佳回答者)
    2021-11-05 01:52

    seata启动需要配置文件,db模式是把配置放到了数据库,file是放到了文件,nacos是放到了配置中心。启动的时候配置不同模式,则会从不同地方获取配置来启动。

    具体的你可以看下文档 5.8.2 章节

    0 讨论(1)
提交回复