1
votes

I have problem with JSF 2 when trying to made several beans injection i receive this error:

GRAVE: JSF ne pourra pas créé le bean géré contact_ lorsqu'il sera demandé.  
Les problèmes suivants ont été détectés :
 - Erreur inattendue lors du traitement du bean géré organisme_
 29 nov. 2012 20:56:23 com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException
GRAVE: Error Rendering View[/index.xhtml]
com.sun.faces.mgbean.ManagedBeanCreationException: Impossible de créer le bean géré contact_.  Les problèmes suivants ont été détectés :
 - Erreur inattendue lors du traitement du bean géré organisme_

here is the beans code :

@ManagedBean (name="organisme_")    
@SessionScoped    
public class Organisme_  implements java.io.Serializable  {    
private static final long serialVersionUID = 4579411552477526993L;    
    private int idOrganisme;    
    @ManagedProperty(value="#{adresse_}")    
    private Adresse_ adresses_organisme;    
private String nomOrganisme;    
     private String telephone;    
     private String fax;    
     private Integer effectif;    
     private String message;    
     private String web;    
//getter and setter    

And

@ManagedBean(name="contact_")    
@RequestScoped    
public class Contact_  implements java.io.Serializable {    
private static final long serialVersionUID = 493917875769565440L;    
    private int idContact;    
     @ManagedProperty(value="#{organisme_}")    
     private Organisme_ organisme;    
 @ManagedProperty(value="#{adresse_}")    
     private Adresse_ adresses;    
     private String nomContact;    
     private String prenomContact;    
     private String email;    
     private String password;    
//getter and setter    
public String Connexion() {return "success";
}

And

@ManagedBean(name="adresse_")    
@RequestScoped    
public class Adresse_  implements java.io.Serializable {    
private int idAdresse;    
    private String pays;    
//getter and setter    

the index page contain :

commandLink action="#{contact_.Connexion()}"  style=" cursor: pointer; text-decoration: none;" </blink>
1
Please do not post error/exception messages in foreign languages. That makes it unnecessarily hard for others to understand your concrete problem (the error/exception message is usually the whole answer at its own, someone has just to translate it into laymans terms for you). Change your environment locale to English (when Googling, you'll also discover that you instantly get many more results and hints in Google when you feed it the English version of the exception/error message).BalusC

1 Answers

5
votes

addresse_ is a RequestScoped bean. You cannot inject a RequestScoped bean in a SessionScoped bean (you will have lots of requests and its related beans and only a session and its bean, it would make no sense to inject one particular instance of addresse_ ignoring all the others).