disconf icon indicating copy to clipboard operation
disconf copied to clipboard

用官网给的demo配置,在spring5下启动会出现报错,而把spring的版本切换到4再启动就正常

Open RoyalYuan opened this issue 7 years ago • 11 comments

在spring5下启动报错如下 [11:26:13:410] [WARN] - com.baidu.disconf.client.store.inner.DisconfCenterStore.storeOneFile(DisconfCenterStore.java:73) - There are two same fileName key!!!! activityrule.xml [11:26:13:443] [ERROR] - org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:321) - Context initialization failed java.lang.NoSuchMethodError: com.baidu.disconf.client.addons.properties.DefaultPropertyPlaceholderConfigurer.parseStringValue(Ljava/lang/String;Ljava/util/Properties;Ljava/util/Set;)Ljava/lang/String; at com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer.parseStringValue(ReloadingPropertyPlaceholderConfigurer.java:97) ~[disconf-client-2.6.36.jar:?] at com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer$PlaceholderResolvingBeanDefinitionVisitor.resolveStringValue(ReloadingPropertyPlaceholderConfigurer.java:457) ~[disconf-client-2.6.36.jar:?] at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanClassName(BeanDefinitionVisitor.java:107) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE] at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:80) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE] at com.baidu.disconf.client.addons.properties.ReloadingPropertyPlaceholderConfigurer.processProperties(ReloadingPropertyPlaceholderConfigurer.java:382) ~[disconf-client-2.6.36.jar:?] at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:86) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:164) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]

RoyalYuan avatar Jan 06 '18 05:01 RoyalYuan

这个issue 本地已修复,目前 打算 自己 重构disconf ~

liaomengge avatar Jan 08 '18 08:01 liaomengge

请教下你是怎么修复的 @liaomengge

RoyalYuan avatar Jan 08 '18 10:01 RoyalYuan

disconfig Spring5.0下报DefaultPropertyPlaceholderConfigurer#parseStringValue方法找不到 个人解决方式:ReloadingPropertyPlaceholderConfigurer image spring 5.0.0 version

nuotang avatar Mar 28 '18 01:03 nuotang

请教下不降级 spring 版本的前提下,你是怎么修复的 @liaomengge ?

iniestano8 avatar Jun 08 '18 12:06 iniestano8

@iniestano8 你可以参考nuotang的处理,我这边项目是重写了这个ReloadingPropertyPlaceholderConfigurer parseStringValue方法,然后,已经升级到2.6.37(升级了所有老版本上的jar包),后续将持续优化处理 ~

liaomengge avatar Jun 11 '18 03:06 liaomengge

@liaomengge 请问何时发布2.6.37,在哪里查看?

tonyhezero avatar Jun 27 '18 07:06 tonyhezero

@qq435967718 基于2.6.36,自己自研的 ~

liaomengge avatar Jun 27 '18 07:06 liaomengge

@liaomengge 老铁你这自研版本是怎么样的?nuotang那个版本是获取不到一些私有属性的

cchheennyd avatar Jul 24 '18 07:07 cchheennyd

disconfig Spring5.0下报DefaultPropertyPlaceholderConfigurer#parseStringValue方法找不到 个人解决方式:ReloadingPropertyPlaceholderConfigurer image spring 5.0.0 version

PropertyPlaceholderConfigurerResolver是私有内部类,怎么可以拿出来的,还请指教?

tenmao avatar Oct 27 '18 03:10 tenmao

disconfig Spring5.0下报DefaultPropertyPlaceholderConfigurer#parseStringValue方法找不到 个人解决方式:ReloadingPropertyPlaceholderConfigurer image spring 5.0.0 version

PropertyPlaceholderConfigurerResolver是私有内部类,怎么可以拿出来的,还请指教?

PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper( placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders); return helper.replacePlaceholders(buf.toString(), props);

gundamff avatar Jan 03 '19 03:01 gundamff

disconfig Spring5.0下报DefaultPropertyPlaceholderConfigurer#parseStringValue方法找不到 个人解决方式:ReloadingPropertyPlaceholderConfigurer image spring 5.0.0 version

PropertyPlaceholderConfigurerResolver是私有内部类,怎么可以拿出来的,还请指教?

PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper( placeholderPrefix, placeholderSuffix, valueSeparator, ignoreUnresolvablePlaceholders); return helper.replacePlaceholders(buf.toString(), props);

不改变原来的代码,直接拷贝一下这个类,自己修改一下。最后重新引用自己的类就可以了。

可以看一下我的主页留言,需求多的话,我重新打包一个客户端发布到maven公共仓库去

bywei avatar Sep 02 '19 08:09 bywei