0

My code:

@Path("/actors")
public class MainController {

  @EJB
  private ActorDaoLocal actorDao;  

}

@Local
public interface ActorDaoLocal { 
  //some stuff here
}

@Stateless
public class ActorDao implements ActorDaoLocal {

  @PersistenceContext
  private EntityManager em ; 
  //some stuff here 
}

@ManagedBean(name = "ActorBean")
@ApplicationScoped
public class ActorBean {

  @EJB
  private ActorDaoLocal usersDao;
}

When I am trying to use actorDao in MainController class, it is null. Why and how to fix it? I also tried to use ActorBean object, but it's also null.

Araneo
  • 477
  • 2
  • 9
  • 25

1 Answers1

1

Tomcat isn't an application server but instead a servlet container. You should use TomEE instead.

António Ribeiro
  • 4,129
  • 5
  • 32
  • 49