使用springboot启动 Dubbo consumer
下为Dubbo.xml
在另一个配置文件中写了Dubbo的属性的配置,文件的目录为src/main/filters/daily.properties
使用mvn clean insall -Pdaily打包
然后使用java -jar xxx.jar 执行jar包
以下为报错日志:
2019-06-08 13:30:47.527 INFO 17735 — [ main] com.dfire.SpringbootdemoApplication : The following profiles are active: daily
2019-06-08 13:30:48.375 INFO 17735 — [ main] c.a.dubbo.common.logger.LoggerFactory : using logger: com.alibaba.dubbo.common.logger.slf4j.Slf4jLoggerAdapter
2019-06-08 13:30:48.993 WARN 17735 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name ' d u b b o . n a m e ′ d e f i n e d i n n u l l : C o u l d n o t r e s o l v e p l a c e h o l d e r ′ d u b b o . n a m e ′ i n v a l u e " {dubbo.name}' defined in null: Could not resolve placeholder 'dubbo.name' in value " dubbo.name′definedinnull:Couldnotresolveplaceholder′dubbo.name′invalue"{dubbo.name}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘dubbo.name’ in value “${dubbo.name}”
2019-06-08 13:30:49.010 INFO 17735 — [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-06-08 13:30:49.021 ERROR 17735 — [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name ' d u b b o . n a m e ′ d e f i n e d i n n u l l : C o u l d n o t r e s o l v e p l a c e h o l d e r ′ d u b b o . n a m e ′ i n v a l u e " {dubbo.name}' defined in null: Could not resolve placeholder 'dubbo.name' in value " dubbo.name′definedinnull:Couldnotresolveplaceholder′dubbo.name′invalue"{dubbo.name}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder ‘dubbo.name’ in value “ d u b b o . n a m e " a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . c o n f i g . P l a c e h o l d e r C o n f i g u r e r S u p p o r t . d o P r o c e s s P r o p e r t i e s ( P l a c e h o l d e r C o n f i g u r e r S u p p o r t . j a v a : 228 ) [ s p r i n g − b e a n s − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P r o p e r t y S o u r c e s P l a c e h o l d e r C o n f i g u r e r . p r o c e s s P r o p e r t i e s ( P r o p e r t y S o u r c e s P l a c e h o l d e r C o n f i g u r e r . j a v a : 182 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P r o p e r t y S o u r c e s P l a c e h o l d e r C o n f i g u r e r . p o s t P r o c e s s B e a n F a c t o r y ( P r o p e r t y S o u r c e s P l a c e h o l d e r C o n f i g u r e r . j a v a : 157 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . i n v o k e B e a n F a c t o r y P o s t P r o c e s s o r s ( P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . j a v a : 286 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . i n v o k e B e a n F a c t o r y P o s t P r o c e s s o r s ( P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . j a v a : 166 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . i n v o k e B e a n F a c t o r y P o s t P r o c e s s o r s ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 705 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 531 ) [ s p r i n g − c o n t e x t − 5.1.6. R E L E A S E . j a r ! / : 5.1.6. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . w e b . s e r v l e t . c o n t e x t . S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . r e f r e s h ( S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . j a v a : 142 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h ( S p r i n g A p p l i c a t i o n . j a v a : 775 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h C o n t e x t ( S p r i n g A p p l i c a t i o n . j a v a : 397 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 316 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1260 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1248 ) [ s p r i n g − b o o t − 2.1.4. R E L E A S E . j a r ! / : 2.1.4. R E L E A S E ] a t c o m . d f i r e . S p r i n g b o o t d e m o A p p l i c a t i o n . m a i n ( S p r i n g b o o t d e m o A p p l i c a t i o n . j a v a : 18 ) [ c l a s s e s ! / : 0.0.1 − S N A P S H O T ] a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e 0 ( N a t i v e M e t h o d ) [ n a : 1.8. 0 9 1 ] a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e ( N a t i v e M e t h o d A c c e s s o r I m p l . j a v a : 62 ) [ n a : 1.8. 0 9 1 ] a t s u n . r e f l e c t . D e l e g a t i n g M e t h o d A c c e s s o r I m p l . i n v o k e ( D e l e g a t i n g M e t h o d A c c e s s o r I m p l . j a v a : 43 ) [ n a : 1.8. 0 9 1 ] a t j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( M e t h o d . j a v a : 498 ) [ n a : 1.8. 0 9 1 ] a t o r g . s p r i n g f r a m e w o r k . b o o t . l o a d e r . M a i n M e t h o d R u n n e r . r u n ( M a i n M e t h o d R u n n e r . j a v a : 48 ) [ s p r i n g b o o t d e m o − 0.0.1 − S N A P S H O T . j a r : 0.0.1 − S N A P S H O T ] a t o r g . s p r i n g f r a m e w o r k . b o o t . l o a d e r . L a u n c h e r . l a u n c h ( L a u n c h e r . j a v a : 87 ) [ s p r i n g b o o t d e m o − 0.0.1 − S N A P S H O T . j a r : 0.0.1 − S N A P S H O T ] a t o r g . s p r i n g f r a m e w o r k . b o o t . l o a d e r . L a u n c h e r . l a u n c h ( L a u n c h e r . j a v a : 50 ) [ s p r i n g b o o t d e m o − 0.0.1 − S N A P S H O T . j a r : 0.0.1 − S N A P S H O T ] a t o r g . s p r i n g f r a m e w o r k . b o o t . l o a d e r . J a r L a u n c h e r . m a i n ( J a r L a u n c h e r . j a v a : 51 ) [ s p r i n g b o o t d e m o − 0.0.1 − S N A P S H O T . j a r : 0.0.1 − S N A P S H O T ] C a u s e d b y : j a v a . l a n g . I l l e g a l A r g u m e n t E x c e p t i o n : C o u l d n o t r e s o l v e p l a c e h o l d e r ′ d u b b o . n a m e ′ i n v a l u e " {dubbo.name}" at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:228) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:182) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:157) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:166) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE] at com.dfire.SpringbootdemoApplication.main(SpringbootdemoApplication.java:18) [classes!/:0.0.1-SNAPSHOT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [springbootdemo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [springbootdemo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) [springbootdemo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) [springbootdemo-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT] Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'dubbo.name' in value " dubbo.name"atorg.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:228) [spring−beans−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.PropertySourcesPlaceholderConfigurer.processProperties(PropertySourcesPlaceholderConfigurer.java:182) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.PropertySourcesPlaceholderConfigurer.postProcessBeanFactory(PropertySourcesPlaceholderConfigurer.java:157) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:166) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) [spring−context−5.1.6.RELEASE.jar!/:5.1.6.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) [spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)[spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)[spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:316)[spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1260)[spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1248)[spring−boot−2.1.4.RELEASE.jar!/:2.1.4.RELEASE]atcom.dfire.SpringbootdemoApplication.main(SpringbootdemoApplication.java:18)[classes!/:0.0.1−SNAPSHOT]atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.091]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.091]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.091]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.091]atorg.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)[springbootdemo−0.0.1−SNAPSHOT.jar:0.0.1−SNAPSHOT]atorg.springframework.boot.loader.Launcher.launch(Launcher.java:87)[springbootdemo−0.0.1−SNAPSHOT.jar:0.0.1−SNAPSHOT]atorg.springframework.boot.loader.Launcher.launch(Launcher.java:50)[springbootdemo−0.0.1−SNAPSHOT.jar:0.0.1−SNAPSHOT]atorg.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)[springbootdemo−0.0.1−SNAPSHOT.jar:0.0.1−SNAPSHOT]Causedby:java.lang.IllegalArgumentException:Couldnotresolveplaceholder′dubbo.name′invalue"{dubbo.name}”
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveStringValue(BeanDefinitionVisitor.java:296) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue(BeanDefinitionVisitor.java:222) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues(BeanDefinitionVisitor.java:147) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition(BeanDefinitionVisitor.java:85) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:225) ~[spring-beans-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
… 21 common frames omitted