Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisconfCenterFile在加载classpath下的disconf.properties路径不正确 #415

Open
luo-isaiah opened this issue Aug 6, 2019 · 0 comments

Comments

@luo-isaiah
Copy link

DisconfCenterFile在加载classpath下的disconf.properties文件时,会因为路径不正确报错

16:28:21.708 [main] ERROR com.baidu.disconf.client.core.processor.impl.DisconfFileCoreProcessorImpl.updateOneConfFile(DisconfFileCoreProcessorImpl.java:128) - cannot get kv data for http-auth.properties
java.lang.Exception: cannot load config file: D:\Workspace\5GDNM\microservice\file-comm-service\file-comm\build\classes\java\main\http-auth.properties
at com.baidu.disconf.client.support.utils.ConfigLoaderUtils.loadConfig(ConfigLoaderUtils.java:107) ~[disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.filetype.impl.DisconfPropertiesProcessorImpl.getKvMap(DisconfPropertiesProcessorImpl.java:23) ~[disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.filetype.FileTypeProcessorUtils.getKvMap(FileTypeProcessorUtils.java:47) ~[disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.processor.impl.DisconfFileCoreProcessorImpl.updateOneConfFile(DisconfFileCoreProcessorImpl.java:125) [disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.processor.impl.DisconfFileCoreProcessorImpl.processOneItem(DisconfFileCoreProcessorImpl.java:78) [disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.processor.impl.DisconfFileCoreProcessorImpl.processAllItems(DisconfFileCoreProcessorImpl.java:65) [disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.core.impl.DisconfCoreMgrImpl.process(DisconfCoreMgrImpl.java:69) [disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.DisconfMgr.firstScan(DisconfMgr.java:98) [disconf-client-2.6.36.jar:?]
at com.baidu.disconf.client.DisconfMgrBean.postProcessBeanDefinitionRegistry(DisconfMgrBean.java:75) [disconf-client-2.6.36.jar:?]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:108) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at com.domc.comm.file.StartUpApp.main(StartUpApp.java:18) [main/:?]

但http-auth.properties在经gradle build后的位置是在
D:\Workspace\5GDNM\microservice\file-comm-service\file-comm\build\classes\java\resources\http-auth.properties

该配置文件由注解@DisconfFile(filename = "http-auth.properties")引入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant