Depois que eu adiciono o @Inject no AdminLivrosBean, como mostrado no video ele mostra esse erro na tela, o que poderia ser?
Codigo AdminLivrosBean:
package br.com.casadocodigo.loja.beans;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import br.com.casadocodigo.loja.daos.LivroDao;
import br.com.casadocodigo.loja.models.Livro;
@Named
@RequestScoped
public class AdminLivrosBean {
private Livro livro = new Livro();
@Inject
private LivroDao dao;
public void salvar() {
System.out.println(livro);
System.out.println("Livro salvo com success");
}
public Livro getLivro() {
return livro;
}
public void setLivro(Livro livro) {
this.livro = livro;
}
}
Codigo do erro
14:28:55,121 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."casadocodigo.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."casadocodigo.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1730)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Unknown Source)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LivroDao with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private br.com.casadocodigo.loja.beans.AdminLivrosBean.dao
at br.com.casadocodigo.loja.beans.AdminLivrosBean.dao(AdminLivrosBean.java:0)
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
14:28:55,129 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "casadocodigo.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"casadocodigo.war\".WeldStartService" => "Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type LivroDao with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private br.com.casadocodigo.loja.beans.AdminLivrosBean.dao
at br.com.casadocodigo.loja.beans.AdminLivrosBean.dao(AdminLivrosBean.java:0)
"}}