WELD-001318 无法解决不明确的依赖关系
我在部署应用程序时遇到错误,如下所示。
Caused by: org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318 Cannot resolve an ambiguous dependency between [
Producer Method [String] with qualifiers [@Any @Config] declared as [[method] @Produces @Config public ca.comdev.cdip.mis.enterpriseportal.configuration.ConfigurationProvider.getConfigurationValue(InjectionPoint)],
Producer Method [String] with qualifiers [@Any @Config] declared as [[method] @Produces @Config public ca.comdev.cdip.mis.enterpriseportal.configuration.ConfigurationProvider.getConfigurationValue(InjectionPoint)]]
我只有这样的方法,其标头如下所示
@Produces @Config public String getConfigurationValue(InjectionPoint p) throws ConfigurationException{...}
,并且类具有这些
@Named
@Singleton
@Startup
public class ConfigurationProvider {...}
请帮助。这个错误可能比我的代码更模糊。
I am getting an error when deploying my application as follows..
Caused by: org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318 Cannot resolve an ambiguous dependency between [
Producer Method [String] with qualifiers [@Any @Config] declared as [[method] @Produces @Config public ca.comdev.cdip.mis.enterpriseportal.configuration.ConfigurationProvider.getConfigurationValue(InjectionPoint)],
Producer Method [String] with qualifiers [@Any @Config] declared as [[method] @Produces @Config public ca.comdev.cdip.mis.enterpriseportal.configuration.ConfigurationProvider.getConfigurationValue(InjectionPoint)]]
And I only have on such method whose header looks like this
@Produces @Config public String getConfigurationValue(InjectionPoint p) throws ConfigurationException{...}
and class has these
@Named
@Singleton
@Startup
public class ConfigurationProvider {...}
Please help. This error is probably more ambiguous than my code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我因在 2 个不同的模块中意外使用相同的 EJB 名称“ExternalClient”而发生此错误。
使用 JBoss 时可以通过在部署期间检查 JNDI 绑定来检测到这一点。 EJB 被实例化多次。
This error occurred to me by accidentally using the same EJB name "ExternalClient" in 2 different modules.
This could be detected when using JBoss by checking the JNDI bindings during deployment. The EJB was instantiated more than once.