I'm having some trouble using the CDI producer shared between different modules. The idea is to declare the producer in module Common.jar :
@Qualifier
@Retention(RUNTIME)
@Target({ TYPE, METHOD, FIELD, PARAMETER })
public @interface Property {
@Nonbinding
String value() default "";
@Nonbinding
boolean required() default true;
}
And :
@ApplicationScoped
public class PropertyProducer implements Serializable {
@Property
@Produces
public String produceString(final InjectionPoint ip) {
return "needed string";
}
And to use it in a different module in model.jar :
@Inject
@Property("model.needed.string")
private String neededString;
This result with the following exception at the run time :
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type String with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private neededString
WELD-001475: The following beans match by type, but none have matching qualifiers:
- Producer Method [String] with qualifiers [@BatchProperty @Any] declared as [[UnbackedAnnotatedMethod] @Produces @BatchProperty public org.jberet.creation.BatchBeanProducer.getString(InjectionPoint)]
The structure is as follow : project structure
Any ideas ?
Thank you.