Problem: an error is reported when building the Seata version of distributed transactions, and the prompt NotSupportYetException: not support register type: null exception prompt shows that there should be a compatibility problem with the version:
Exception in thread "main" io.seata.common.exception.NotSupportYetException: not support register type: null at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:80) at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:65) at io.seata.server.metrics.MetricsManager.init(MetricsManager.java:49) at io.seata.server.Server.main(Server.java:56) Caused by: java.lang.IllegalArgumentException: illegal type:null at io.seata.config.ConfigType.getType(ConfigType.java:62) at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:78) ... 3 more
Then check POM XML file, then the version was spring cloud alibaba-2.1 0. The version of Seata is seata-0.9 0, but you will find that the @ GlobalTransactional annotation cannot be introduced into this Alibaba version and Seata version, so you will resolutely upgrade the Seata version to 1.3 Version 0. You can use the @ GlobalTransactional annotation.
Why upgrade 1.3.1 decisively 0, because the latest official document shows seata-1.3 0
<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-seata</artifactId> <exclusions> <exclusion> <artifactId>seata-all</artifactId> <groupId>io.seata</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> <version>1.3.0</version> </dependency>
As a result, the following error occurred when starting the project. not support register type: null
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:656) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:484) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]
Finally, I tried many packages and found that the problem was still reported. Finally, I read the Seata document https://seata.io/zh-cn/docs/user/configurations.html , at seata-1.0 After version 0, Seata is introduced in another way Package. This introduction is a bit like integrating MyBatis with spring boot and introducing MyBatis spring boot starter. If you introduce MyBatis spring, you need to pay attention to the version number.
Reintroduce the Seata package in the starter mode, as shown below:
<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-seata</artifactId> <exclusions> <exclusion> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> <version>1.4.0</version> </dependency>
After introducing seata-1.4 After version 0, it still reported the above problems. Finally, there was no way to continue Baidu. Finally, it was found that all the original answers had been stated in other people's official documents. Compatible version numbers are required between components. In the future, try to read the official website documents first, and click in to see them!
Alibaba / spring cloud Alibaba component version relationship
As can be seen from the above version number, seata-1.4 Version 0 must at least use spring cloud Alibaba 2 2.6 started, so I quickly upgraded spring cloud Alibaba to a stable version, and finally tried 2.2 Version 1 is also compatible with seata1 4.0. Because the recommended version number on the official website of spring cloud Alibaba is, it was finally decided to use 2.2 Version 1.
Finally, let's see that the three versions of SpringBoot, SpringCloud and SpringCloudAlibaba are compatible, as shown below:
Reference links for SpringBoot, Cloud, CloudAlibaba versions and Alibaba component versions
Reference links for SpringBoot/Cloud/CloudAlibaba versions and Alibaba component versions
Seata Service Download
Seata quick start