0

i get this error : "com.sun.faces.mgbean.ManagedBeanCreationException: No se puede definir la propiedad procesos para el bean administrado procesos" when i run my web app. Roughly translated "cannot define property procesos for the managed property procesos"

this is my managed bean with the issue:

@ManagedBean(name = "procesos")
@ViewScoped
public class ProcesosBean implements Serializable {
    @ManagedProperty(value="#{user}")

    private List<VistaProcesosEntity> procesos;
    private LoginBean loginBean;

    @PostConstruct
    public void init(){
       UsuariosEntity user=loginBean.getCurrent();
       procesos=new ArrayList<VistaProcesosEntity>();

       if (user.getTipo().equalsIgnoreCase("Planta")) {
        procesos= Procesos.getALL();
        }else if(user.getTipo().equalsIgnoreCase("Exportadora")){
            procesos=Procesos.getALLbyExportadora(user.getUsuario());
        }  else if (user.getTipo().equalsIgnoreCase("Productor")){
            procesos=Procesos.getALLbyProductor(user.getUsuario());
        }

    }

    public LoginBean getLoginBean() {
        return loginBean;
    }

    public void setLoginBean(LoginBean loginBean) {
        this.loginBean = loginBean;
    }

    public List<VistaProcesosEntity> getProcesos() {
        return procesos;
    }

    public void setProcesos(List<VistaProcesosEntity> procesos) {
        this.procesos = procesos;
    }
}
Menno
  • 12,175
  • 14
  • 56
  • 88
user1462933
  • 1,179
  • 2
  • 12
  • 24

1 Answers1

2
@ManagedProperty(value="#{user}")

private List<VistaProcesosEntity> procesos;
private LoginBean loginBean;

Above should be:

@ManagedProperty(value="#{user}")
private LoginBean loginBean;

private List<VistaProcesosEntity> procesos;

The annotation @ManagedProperty references the following object (so in the first case procesos). This is causing your error.

Menno
  • 12,175
  • 14
  • 56
  • 88
  • LOL! now it worked perfectly! thanks a lot for your help! i have to wait 10 mins to accept your answer as the right answer because i already accepted your answer for my other question :) – user1462933 Apr 30 '13 at 17:42
  • @user1462933 The waiting time is caused by a minimum time between creating the question and accepting an answer. :) – Menno Apr 30 '13 at 18:08