部署我的应用程序时出现错误,如下所示.
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)]]
Run Code Online (Sandbox Code Playgroud)
我只有这样的方法,其标题看起来像这样
@Produces @Config public String getConfigurationValue(InjectionPoint p) throws ConfigurationException{...}
Run Code Online (Sandbox Code Playgroud)
和班级有这些
@Named
@Singleton
@Startup
public class ConfigurationProvider {...}
Run Code Online (Sandbox Code Playgroud)
请帮忙.这个错误可能比我的代码更模糊.
我有一个在其签名中使用抽象类的接口.然后我的实现在其签名中使用抽象类的子类,但这是不允许的.有人可以帮我吗?我在googles上找到的只是通用接口和抽象类实现......
public MyAbstractClass {
abstract public void myMethod();
}
public MySubClass : MyAbstractClass {
override public void myMethod(){
...
}
}
Run Code Online (Sandbox Code Playgroud)
然后我有我的接口/实现..
public interface MyInterface {
MyAbstractClass myInterfaceMethod(MyAbstractClass blah);
}
public MyImplementation : MyInterface {
MySubClass myInterfaeMethod(MySubClass blah){
...
}
}
Run Code Online (Sandbox Code Playgroud)
但我得到一个错误,说myInterfaceMethod没有实现接口方法...
救命?