javax.el.MethodNotFoundException [closed]

2

Good afternoon guys, I'd like your help for an error that I still do not understand why it happens.

The situation is: I have a method in my managedBean listTurmas that loads a list so that later I can use, I already tested this method in a test in the console and worked perfectly, however when calling this method via JSF the following error is returned :

javax.el.MethodNotFoundException: /paginaListagem.xhtml @13,90 action="#{controllerTurma.listarTurmas}": Method not found: [email protected]()

JSF call:

<h:form><h:commandButton value="Consultar" action="#{controllerTurma.listarTurmas}" /></h:form>

DAO List Method:

    @SuppressWarnings("unchecked")
public List<T> consultarTodos(Class<T> classe){
    EntityManager em = getEM();
    List<T> objetosBuscados = null;             
    try {           
        objetosBuscados = em.createQuery("FROM "+classe.getName()).getResultList();         
    } catch (Exception e) {
        e.printStackTrace();
    }finally {
        em.close();
    }
    return objetosBuscados;
}

Method call on Controller:

public void listarTurmas(){
TurmaNegocio tn = new TurmaNegocio();
this.turmas = tn.consultarTodos();  

for (Turma turma : turmas) {
    System.out.println(turma.getDescricao());
}}
    
asked by anonymous 16.09.2016 / 17:31

0 answers