No bean corresponds to CDI injection point

Asked

Viewed 542 times

3

I’m looking to implement CDI. But when I use the @Inject annotation I’m notified with this warning

"No bean corresponds to the injection point"

Code line I’m notified of

@Inject private LancamentoDadosDao lancamentoDadosDao;

DAO class

    @Component
    @RequestScoped
    public class LancamentoDadosDao {

        private Session session;
        private Result result;

        public LancamentoDadosDao(Session session, Result result) {
            this.session = session;
            this.result = result;
        }
}

What may be happening for this Warning to appear ?

1 answer

1

To be used with CDI your class needs to have a constructor without parameters or your constructor with parameters should be annotated with @Inject (but ai ensure that the parameters will be injected correctly).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.