apache / apache/incubator-seata
使用application.yml配置registry, 报io.seata.common.exception.NotSupportYetException: config type can not be null
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
使用application.yml配置registry, 报io.seata.common.exception.NotSupportYetException: config type can not be null
不想使用registry.conf文件和file.conf文件配置seata,直接在application.yml配置seata连接nacos的注册中心和配置中心。
但是好像不生效
Excetion stack:
Connected to the target VM, address: '127.0.0.1:2884', transport: 'socket'
2020-07-31 21:42:35.554 INFO 21192 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$457e18c0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.10.RELEASE)
2020-07-31 21:42:37.054 INFO 21192 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource {name='NACOS', propertySources=[NacosPropertySource {name='order-service.yaml'}]}
2020-07-31 21:42:37.060 INFO 21192 --- [ main] com.codebattery.Application : No active profile set, falling back to default profiles: default
2020-07-31 21:42:38.505 WARN 21192 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'nacos-config' contains invalid characters, please migrate to a valid format.
2020-07-31 21:42:38.508 WARN 21192 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'nacos-discovery' contains invalid characters, please migrate to a valid format.
2020-07-31 21:42:38.868 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2020-07-31 21:42:38.868 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-07-31 21:42:38.991 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 113ms. Found 1 repository interfaces.
2020-07-31 21:42:39.008 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2020-07-31 21:42:39.010 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2020-07-31 21:42:39.036 INFO 21192 --- [ main] .RepositoryConfigurationExtensionSupport : Spring Data Redis - Could not safely identify store assignment for repository candidate interface com.codebattery.repository.OrderRepository. If you want this repository to be a Redis repository, consider annotating your entities with one of these annotations: org.springframework.data.redis.core.RedisHash (preferred), or consider extending one of the following types with your repository: org.springframework.data.keyvalue.repository.KeyValueRepository.
2020-07-31 21:42:39.036 INFO 21192 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 15ms. Found 0 repository interfaces.
2020-07-31 21:42:39.171 WARN 21192 --- [ main] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2020-07-31 21:42:39.667 INFO 21192 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=c5ca8343-8930-3dcd-a0dd-641b465c81df
2020-07-31 21:42:39.893 INFO 21192 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-07-31 21:42:39.899 INFO 21192 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.cloud.alibaba.seata-com.alibaba.cloud.seata.SeataProperties' of type [com.alibaba.cloud.seata.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-07-31 21:42:39.900 INFO 21192 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration' of type [com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$b6901f3e] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-07-31 21:42:53.234 WARN 21192 --- [ 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 [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: config type can not be null
2020-07-31 21:42:53.258 INFO 21192 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-07-31 21:42:53.292 ERROR 21192 --- [ 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: config type can not be null
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$144/1189651769.getObject(Unknown Source) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:228) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:721) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:534) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.10.RELEASE.jar:2.1.10.RELEASE]
at com.codebattery.Application.main(Application.java:27) [classes/:na]
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: config type can not be null
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
... 20 common frames omitted
Caused by: io.seata.common.exception.NotSupportYetException: **config type can not be null**
at io.seata.config.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:106) ~[seata-all-1.3.0.jar:1.3.0]
at io.seata.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:90) ~[seata-all-1.3.0.jar:1.3.0]
at io.seata.spring.annotation.GlobalTransactionScanner.(GlobalTransactionScanner.java:81) ~[seata-all-1.3.0.jar:1.3.0]
at io.seata.spring.annotation.GlobalTransactionScanner.(GlobalTransactionScanner.java:125) ~[seata-all-1.3.0.jar:1.3.0]
at io.seata.spring.annotation.GlobalTransactionScanner.(GlobalTransactionScanner.java:114) ~[seata-all-1.3.0.jar:1.3.0]
at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration.globalTransactionScanner(GlobalTransactionAutoConfiguration.java:58) ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$b6901f3e.CGLIB$globalTransactionScanner$0() ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$b6901f3e$$FastClassBySpringCGLIB$$49d1a1f5.invoke() ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.11.RELEASE.jar:5.1.11.RELEASE]
at com.alibaba.cloud.seata.GlobalTransactionAutoConfiguration$$EnhancerBySpringCGLIB$$b6901f3e.globalTransactionScanner() ~[spring-cloud-alibaba-seata-2.1.0.RELEASE.jar:2.1.0.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_51]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.11.RELEASE.jar:5.1.11.RELEASE]
... 21 common frames omitted
Disconnected from the target VM, address: '127.0.0.1:2884', transport: 'socket'
Process finished with exit code 1
环境:
JDK 1.8
Spring Cloud Greenwich.SR4
spring-cloud-starter-alibaba-seata:2.1.10.RELEASE
io.seata:seata-all:1.3.0
使用到的配置
seata:
enabled: true
application-id: ${spring.application.name}
tx-service-group: my_test_tx_group
# enable-auto-data-source-proxy: true
# data-source-proxy-mode: XA
use-jdk-proxy: false
# excludes-for-auto-proxying: firstClassNameForExclude,secondClassNameForExclude
service:
vgroup-mapping:
my_test_tx_group: default
grouplist:
default: 192.168.3.31:8091
enable-degrade: false
disable-global-transaction: false
config:
type: nacos
nacos:
namespace: bde377f9-9270-4b3d-a5ee-a29c5f5672cc
serverAddr: 192.168.3.31:8848
group: seata
username: ""
password: ""
registry:
type: nacos
nacos:
application: seata-server
server-addr: 192.168.3.31:8848
group : seata
namespace: bde377f9-9270-4b3d-a5ee-a29c5f5672cc
username: ""
password: ""
Contributor guide
Research direction
Start with ConfigurationFactory.java:106 and GlobalTransactionAutoConfiguration.java:58 from the stack trace, then inspect how application.yml is passed into Seata compared with registry.conf and file.conf. Reproduce the application startup using the reported configuration; done means registry and config center settings from application.yml are accepted without the config type exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100