Exception in thread "main" java. lang. IllegalStateException:
No application config found or it's not a valid config! Please add < dubbo: application name= "..." / > to your spring config.
首先确定配置是否正确:(参考)
< ? xml version= "1.0" encoding= "UTF-8" ? >
< beans xmlns: xsi= "http://www.w3.org/2001/XMLSchema-instance"
xmlns: dubbo= "http://dubbo.apache.org/schema/dubbo" xmlns= "http://www.springframework.org/schema/beans"
xsi: schemaLocation= "http: / / www. springframework. org/ schema/ beans http: / / www. springframework. org/ schema/ beans/ spring- beans- 4.3 . xsd
http: / / dubbo. apache. org/ schema/ dubbo http: / / dubbo. apache. org/ schema/ dubbo/ dubbo. xsd">
< dubbo: application name= "provider" / >
< dubbo: registry address= "zookeeper://127.0.0.1:2181" / >
< dubbo: protocol name= "dubbo" / >
< bean id= "helloService" class = "com.demo.service.HelloServiceImpl" / >
< dubbo: service interface = "com.demo.HelloService" ref= "helloService" / >
< / beans>
如果配置文件没有问题,对工程重新clean,构建 如果仍有问题,则是由于dubbo和spring版本不兼容导致,将dubbo高于2.7.5的版本降到2.7.3即可