1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[JBoss] Injection causes WELD-001408: Unsatisfied dependencies

Discussão em 'StackOverflow' iniciado por Stack, Setembro 10, 2021.

  1. Stack

    Stack Membro Participativo

    I have a java EE web application in which a particular injection causes following error:


    WELD-001408: Unsatisfied dependencies for type GenericDAO with qualifiers @Default

    MyBean

    @Stateless
    public class MyBean extends CustomBean<Entity> {
    ...
    }


    CustomBean

    public class CustomBean<T extends Serializable> implements Serializable {
    @Inject
    private GenericDAO<T> genericDAO;
    }


    GenericDAO

    public abstract class GenericDAO<T extends Serializable> implements Serializable {
    ...
    }


    The issue appears only if a beans.xml is defined in the application. Deleting this, solves also the issue. In my case beans.xml is needed. Also when removing the GenericDAO<T> genericDAO; injection from the CustomBean, the error does not appear anymore. Also the rest of my injection in other classes, seem to work without any issue.

    I've tried to solve that by creating an interface of GenericDAO and inject the interface instead. Also tried to with several anotations like @Local , @Dependent etc but i stumble upon different errors every time.

    Continue reading...

Compartilhe esta Página