8:18:15,863 ERROR [org.jboss.as.server] (management-handler-thread - 16) WFLYSRV0021: Deploy of deployment "Livraria3.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"Livraria3.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Livraria3.war\".WeldStartService: Failed to start service
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type EntityManager with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject br.com.rogerio.transacao.GerenciamentoDeTransacoes.manager
at br.com.rogerio.transacao.GerenciamentoDeTransacoes.manager(GerenciamentoDeTransacoes.java:0)
*************************************************************************************
package br.com.rogerio.transacao;
import java.io.Serializable;
import javax.inject.Inject;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;
import javax.persistence.EntityManager;
@Transacional
@Interceptor
public class GerenciadorDeTransacao implements Serializable {
private static final long serialVersionUID = 1L;
@Inject
EntityManager manager;
@AroundInvoke
public Object executaTx(InvocationContext context) throws Exception {
//abre a transacao
manager.getTransaction().begin();
//chama os daos que precise de uma transaçao
Object resultado = context.proceed();
// commita a transacao
manager.getTransaction().commit();
return resultado;
}
}