Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/381.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java WELD-001318无法解析不明确的依赖项_Java_Java Ee 6_Cdi_Jboss Weld - Fatal编程技术网

Java WELD-001318无法解析不明确的依赖项

Java WELD-001318无法解析不明确的依赖项,java,java-ee-6,cdi,jboss-weld,Java,Java Ee 6,Cdi,Jboss Weld,我在部署我的应用程序时遇到一个错误,如下所示 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 pub

我在部署我的应用程序时遇到一个错误,如下所示

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 {...}

请帮忙。这个错误可能比我的代码更模糊。

这个错误是我在两个不同的模块中意外地使用了相同的EJB名称“ExternalClient”

 <enterprise-beans>
    <session>
        <ejb-name>ExternalClient</ejb-name> <!-- DUPLICATED -->
        <ejb-class>com.company.ExternalClient</ejb-class>
        <session-type>Stateless</session-type>
        <env-entry>
            <env-entry-name>url</env-entry-name>
            <env-entry-type>java.lang.String</env-entry-type>
            <env-entry-value>http://company.com/API</env-entry-value>
        </env-entry>
    </session>
</enterprise-beans>

外部客户端
com.company.ExternalClient
无国籍
网址
java.lang.String
http://company.com/API

使用JBoss时,可以通过在部署期间检查JNDI绑定来检测到这一点。EJB被实例化了不止一次。

真奇怪。您能否确保在类路径上没有两次相同的类,例如在不同的jar(bean归档)中?