Browse Source

最新alibaba/seata版本无需处理循环引用问题

master
RuoYi 3 years ago
parent
commit
68040827e2
  1. 26
      ruoyi-common/ruoyi-common-datasource/src/main/java/com/ruoyi/common/datasource/env/ApplicationSeataInitializer.java
  2. 2
      ruoyi-common/ruoyi-common-datasource/src/main/resources/META-INF/spring.factories

26
ruoyi-common/ruoyi-common-datasource/src/main/java/com/ruoyi/common/datasource/env/ApplicationSeataInitializer.java vendored

@ -1,26 +0,0 @@
package com.ruoyi.common.datasource.env;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.env.ConfigurableEnvironment;
/**
* seata springboot 2.6.x 存在循环引用问题的处理
*
* @author ruoyi
*/
public class ApplicationSeataInitializer implements EnvironmentPostProcessor, Ordered
{
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application)
{
System.setProperty("spring.main.allow-circular-references", "true");
}
@Override
public int getOrder()
{
return Ordered.LOWEST_PRECEDENCE;
}
}

2
ruoyi-common/ruoyi-common-datasource/src/main/resources/META-INF/spring.factories

@ -1,2 +0,0 @@
org.springframework.boot.env.EnvironmentPostProcessor=\
com.ruoyi.common.datasource.env.ApplicationSeataInitializer
Loading…
Cancel
Save