seata分布式事务启动问题

Blade 未结 2 3007
tjbaike
tjbaike 剑圣 2020-08-19 14:26

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

问题描述:前台请求desk模块的controller进行流程启动,desk模块调用flow模块启动流程,并在数据库插入数据

1. desk模块的pom文件按照官方文档引入seata依赖

2. desk模块的主启动类按照官方文档加上

@SeataCloudApplication

3. desk模块的实现类对应的方法加上 @Transactional(rollbackFor = Exception.class)和 @GlobalTransactional

4. 启动desk模块报错


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

  启动成功,并在流程启动失败时回滚事务

  模块无法启动,报错


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

 bladeX商业版,2.5.0,Windows10操作系统


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


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

2020-08-19 14:16:21.726 ERROR 1176 --- [           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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49)

at org.springblade.desk.DeskApplication.main(DeskApplication.java:36)

Caused by: 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.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)

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

... 19 common frames omitted

Caused by: io.seata.common.exception.NotSupportYetException: not support register type: null

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

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

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

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

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

at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration.globalTransactionScanner(GlobalTransactionAutoConfiguration.java:58)

at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$c28a6ac2.CGLIB$globalTransactionScanner$0(<generated>)

at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$c28a6ac2$$FastClassBySpringCGLIB$$df19c195.invoke(<generated>)

at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)

at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)

at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$c28a6ac2.globalTransactionScanner(<generated>)

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)

... 20 common frames omitted

Caused by: io.seata.common.exception.ShouldNeverHappenException: Can't find any object of class org.springframework.context.ApplicationContext

at io.seata.common.holder.ObjectHolder.lambda$getObject$0(ObjectHolder.java:40)

at java.util.Optional.orElseThrow(Optional.java:290)

at io.seata.common.holder.ObjectHolder.getObject(ObjectHolder.java:40)

at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.get(SpringBootConfigurationProvider.java:93)

at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider.access$100(SpringBootConfigurationProvider.java:43)

at io.seata.spring.boot.autoconfigure.provider.SpringBootConfigurationProvider$1.intercept(SpringBootConfigurationProvider.java:56)

at io.seata.config.FileConfiguration$$EnhancerByCGLIB$$862af1eb.getConfig(<generated>)

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

... 35 common frames omitted


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

  我的注册邮箱是购买时的邮箱

2条回答
  • 估计你seata启动配置的问题,按文档步骤配置seata

    H26EHREVG4QE}GQX8I4KTCH.png

    0 讨论(4)
  • 2024-05-13 18:46

    加了分布式事务,启动太慢是咋回事?

    0 讨论(0)
提交回复