I'm using WELD SE on a standalone java project which seemed to work fine till I started using producers.
The producer method works - the container uses it, but never injects the inner pdependencies of the produced bean. When I remove the producer, it works normally. I can't find the cause even after a long search on the spec and on Google.
Example of a Producer:
@ApplicationScoped
public class LaminaValidadorProducer {
private static final String XSD_PATH = getConfig("processador.xsd.path");
private static final Map<VersaoLamina,String> XSD_PER_VERSION = new HashMap<>();
static {
XSD_PER_VERSION.put(VersaoLamina.V1, getConfig("processador.lamina.xsd.file"));
XSD_PER_VERSION.put(VersaoLamina.V2, getConfig("processador.laminav2.xsd.file"));
}
@Produces
public LaminaValidador buildValidador() {
return new LaminaValidador(XSD_PATH, XSD_PER_VERSION);
}
}
LaminaValidador is injected normally, but its INNER attributes (marked with @Inject) are not being injected. THe project has a beans.xml with bean-discovery-mode="all".
Any clues on what's happening?