Skip to content

Commit

Permalink
bugfix: impl of supportsSourceType is not defined (#7104)
Browse files Browse the repository at this point in the history
* bugfix: impl of supportsSourceType is not defined
  • Loading branch information
funky-eyes authored Jan 12, 2025
1 parent 2438d77 commit 90aa994
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 64 deletions.
3 changes: 2 additions & 1 deletion changes/en-us/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Add changes here for all PR submitted to the 2.x branch.

### bugfix:

- [[#PR_NO](https://github.com/apache/incubator-seata/pull/#PR_NO)] fix XXX
- [[#7104](https://github.com/apache/incubator-seata/pull/7104)] fix impl of supportsSourceType is not defined


### optimize:

Expand Down
2 changes: 1 addition & 1 deletion changes/zh-cn/2.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### bugfix:

- [[#PR_NO](https://github.com/apache/incubator-seata/pull/#PR_NO)] 修复XXX
- [[#7104](https://github.com/apache/incubator-seata/pull/7104)] 修复SeataApplicationListener在低版本springboot未实现supportsSourceType方法的问题

### optimize:

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.seata.spring.boot.autoconfigure.loader;

import org.apache.seata.common.holder.ObjectHolder;
import org.apache.seata.common.util.CollectionUtils;
import org.apache.seata.common.util.StringUtils;
import org.apache.seata.config.ConfigurationFactory;
Expand Down Expand Up @@ -43,6 +44,7 @@
import static org.apache.seata.common.ConfigurationKeys.SERVER_PREFIX;
import static org.apache.seata.common.ConfigurationKeys.STORE_PREFIX;
import static org.apache.seata.common.ConfigurationKeys.TRANSPORT_PREFIX;
import static org.apache.seata.common.Constants.OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT;

@Order(Ordered.HIGHEST_PRECEDENCE)
public class SeataPropertiesLoader implements ApplicationContextInitializer<ConfigurableApplicationContext> {
Expand All @@ -53,6 +55,10 @@ public class SeataPropertiesLoader implements ApplicationContextInitializer<Conf
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
ConfigurableEnvironment environment = applicationContext.getEnvironment();
if (ObjectHolder.INSTANCE.getObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT) == null) {
ObjectHolder.INSTANCE.setObject(OBJECT_KEY_SPRING_CONFIGURABLE_ENVIRONMENT,
applicationContext.getEnvironment());
}
FileConfiguration configuration = ConfigurationFactory.getOriginFileInstanceRegistry();
FileConfig fileConfig = configuration.getFileConfig();
Map<String, Object> configs = fileConfig.getAllConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ org.apache.seata.spring.boot.autoconfigure.SeataCoreEnvironmentPostProcessor

org.springframework.context.ApplicationContextInitializer=\
org.apache.seata.spring.boot.autoconfigure.loader.SeataPropertiesLoader

org.springframework.context.ApplicationListener=\
org.apache.seata.spring.boot.autoconfigure.listener.SeataApplicationListener

0 comments on commit 90aa994

Please sign in to comment.