Insaf
Insaf

Reputation: 39

JSF : com.sun.faces.mgbean.ManagedBeanCreationException

Here is my managed bean class :

package JSFinwis;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;


@ManagedBean(name="authentificationBean")
@RequestScoped
public class authentificationBean implements Serializable {

List<clientBean> clients = new ArrayList<clientBean>();

private static final long serialVersionUID = 1L;

public authentificationBean() {
    super();
    clients.add(new    clientBean("X","Y","Z","T","W",new Date("1995-31-03")));
}

public List<clientBean> getClients()
{
    return this.clients;
}
}

However, I am getting this error :

com.sun.faces.mgbean.ManagedBeanCreationException: Impossible d’instancier la classe «JSFinwis.authentificationBean».

How can I solve this ?

Upvotes: 0

Views: 1637

Answers (1)

Ced
Ced

Reputation: 17337

Some hints:

  1. you have super(); in your constructor. remove that. Your class doesn't extends anything.
  2. Is clientBean managed ? If so you shouldn't instantiate it yourself.
  3. you should switch to CDI managed beans
  4. CamelCase your class names.
  5. I don't think making a RequestScoped bean Serializable serves any purpose since it's used only once.

Upvotes: 1

Related Questions