I am trying to inject a @Injection
ed bean into a WebService
, but the bean is always null.
Dependency injection is working on my project. When I use @Injection
inside a Managebean for a jsp page everything is ok.
@WebService
public class listaUsuariosWS {
@Inject private LoginService loginService;
public String getName(){
List<Usuario> lst = loginService.listarTodos();
Usuario u = lst.get(1);
String nome = u.getNomeUsuario();
return nome;
}
}
Any idea what it could be?