0

i have 2 EJB implements same interface, i have some qualifier :

@java.lang.annotation.Documented
@java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE,ElementType.FIELD})
@javax.inject.Qualifier
public @interface PayEseConnector {

}

and

@java.lang.annotation.Documented
@java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE,ElementType.FIELD})
@javax.inject.Qualifier
public @interface MetrilioConnector {

}

example of EJB:

@Stateless
@PayEseConnector
@Local
public class PayEseServiceImpl implements IConnectorService {

or

@Stateless
@MetrilioConnector
@Local
public class MetrilioServiceImpl implements IConnectorService {

i inject one of those into a class:

public class TestResource {

@MetrilioConnector
@Inject 
IConnectorService metrilioService;

and my error :

Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type IConnectorService with qualifiers @MetrilioConnector at injection point [UnbackedAnnotatedField] @MetrilioConnector @Inject com.real.hr.rest.TestResource.metrilioService at com.real.hr.rest.TestResource.metrilioService(TestResource.java:0) WELD-001475: The following beans match by type, but none have matching qualifiers: - Session bean [class com.real.hr.services.MetrilioServiceImpl with qualifiers [@MetrilioConnector @Any]; local interfaces are [IConnectorService], - Session bean [class com.real.hr.services.PayEseServiceImpl with qualifiers [@PayEseConnector @Any]; local interfaces are [IConnectorService]

what i am doing wrong?, with one @Qualifier it is working

cyril
  • 872
  • 6
  • 29

1 Answers1

0

Finally the example is OK the error was i renamed a package and dependency was still present so you can use this example to make simple Qualifier for EJB implements same interface, normally @Local is not mandatory...

cyril
  • 872
  • 6
  • 29