Dubbo 启动 Duplicate application configs: 问题

发布于 2021-11-29 17:26:59 字数 3761 浏览 1037 评论 8

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.yesen.service.UserService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="banksteel-user-provider" id="banksteel-user-provider" /> and <dubbo:application name="banksteel-user-provider" id="banksteel-user-provider2" />

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744)

Caused by: java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="banksteel-user-provider" id="banksteel-user-provider" /> and <dubbo:application name="banksteel-user-provider" id="banksteel-user-provider2" />

at com.alibaba.dubbo.config.spring.ServiceBean.afterPropertiesSet(ServiceBean.java:164)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)

... 25 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

私藏温柔 2021-12-03 15:14:49

spring文件重复加载了吧

情绪失控 2021-12-03 15:14:47

应该是加载了两次,排查下吧

情绪失控 2021-12-03 15:14:41
nested exception is java.lang.IllegalStateException: Duplicate application configs: <dubbo:application name="banksteel-user-providersss" id="banksteel-user-providersss" /> and <dubbo:application name="banksteel-user-providersss" id="banksteel-user-providersss2" />

我把自己的provider 改成 providersss 后面那个也跟着一样改了,那是不是说明这个xml被加载了2次?

心舞飞扬 2021-12-03 15:13:15

回复
name 重复了

琴流音 2021-12-03 15:10:02

回复
@沧海_Sea : 可是我配置文件里就只有一个 <!-- 提供方应用信息,用于计算依赖关系 --> <dubbo:application name="banksteel-user-provider"/> 我找了很多次都没找到第二个

策马西风 2021-12-03 13:43:46

<dubbo:application name="banksteel-user-provider" id="banksteel-user-provider" /> and <dubbo:application name="banksteel-user-provider" id="banksteel-user-provider2" />

风透绣罗衣 2021-12-03 11:15:49

只有一个 这是我的代码 <!-- 提供方应用信息,用于计算依赖关系 --> <dubbo:application name="banksteel-user-provider"/>

自此以后,行同陌路 2021-12-02 16:34:56

你加载的配置文件里<dubbo:application>只能有一个

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文