Closed Mr-hu7050 closed 1 year ago
Would you please submit a demo? It seems that spring has override dubbo's method.
https://github.com/iswift/dubbo-demo 代码已上传到github上
mark
这个我这边直接启动时正常的,你的部署方式可以给一下吗
打成war包,部署在外置的Tomcat种,不要用Application类启动。
给的 Demo 打包不了
代码已更新,可以打包了
看了下在 Tomcat 部署状态下会有一个 jndi 数据源,而这个数据源无法判断 dubbo 的配置是否存在,进而不断拆开 Dubbo 的配置,把一些内部的 Transient 的属性也加载了。
目前除了把 Dubbo 内部的强校验给删除没想到还有好的方法,但是删除校验会把 Dubbo 代码兜底的能力给移除。
Environment
Steps to reproduce this issue
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'dubbo-org.apache.dubbo.spring.boot.autoconfigure.DubboConfigurationProperties': Could not bind properties to 'DubboConfigurationProperties' : prefix=dubbo, ignoreInvalidFields=false, ignoreUnknownFields=true at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:99) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:79) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1754) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:961) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:584) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:174) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:154) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:96) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4875) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 43 more Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'dubbo.consumer.exported-urls[0].or-default-framework-model.model-environment' to org.apache.dubbo.common.config.Environment at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:387) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:347) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:472) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:98) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:86) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:476) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:576) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:474) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:414) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:472) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:98) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:86) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:476) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:576) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:474) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:414) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$1(Binder.java:435) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:566) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:436) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:106) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:86) at org.springframework.boot.context.properties.bind.IndexedElementsBinder.bindIndexed(IndexedElementsBinder.java:70) at org.springframework.boot.context.properties.bind.CollectionBinder.bindAggregate(CollectionBinder.java:49) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:438) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:438) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:399) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:472) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:98) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:86) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:476) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:576) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:474) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:414) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:472) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:98) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:86) at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:476) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:576) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:474) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:414) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:332) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:262) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:249) at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:93) at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:96) ... 65 more Caused by: java.lang.IllegalStateException: Unable to get value for property model-environment at org.springframework.boot.context.properties.bind.JavaBeanBinder$BeanProperty.lambda$getValue$0(JavaBeanBinder.java:360) at org.springframework.boot.context.properties.bind.DefaultBindConstructorProvider.getBindConstructor(DefaultBindConstructorProvider.java:48) at org.springframework.boot.context.properties.bind.ValueObjectBinder$ValueObject.get(ValueObjectBinder.java:190) at org.springframework.boot.context.properties.bind.ValueObjectBinder.bind(ValueObjectBinder.java:67) at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:476) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:576) at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:474) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:414) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) ... 123 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.boot.context.properties.bind.JavaBeanBinder$BeanProperty.lambda$getValue$0(JavaBeanBinder.java:357) ... 132 more Caused by: java.lang.UnsupportedOperationException: Environment is inaccessible for FrameworkModel at org.apache.dubbo.rpc.model.FrameworkModel.getModelEnvironment(FrameworkModel.java:346) ... 137 more