IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JDBC Java Discussion :

Error calling action method of component


Sujet :

JDBC Java

  1. #1
    Nouveau membre du Club
    Inscrit en
    Mars 2007
    Messages
    70
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 70
    Points : 27
    Points
    27
    Par défaut Error calling action method of component
    j'ai crée une page jsp pour l'authentification :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    <h:form>
     
    <h:panelGrid columns="2" style="background-color: #FF8000">
     
    <h:outputText value="Login :"></h:outputText><h:inputText value="#{identifyUser.log}"></h:inputText>
     
    <h:outputText value="Mot de passe:"></h:outputText><h:inputSecret value="#{identifyUser.passw}"></h:inputSecret>
    </h:panelGrid>
     
    <h:commandButton value="Se Connecter " action="#{identifyUser.verifier}"></h:commandButton><br/><br/>
     
    <h:outputText id="mess" value="#{identifyUser.mes}" style="color: #FF0000; font-size: 30px"></h:outputText>
    </center>
    </h:form>
    Le bean associé est le suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
     
    package bean;
     
    import java.util.Iterator;
     
    import org.hibernate.Query;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
     
    import stt.Utilisateur;
     
    public class IdentifyUser
     
    {
    	private String log;
    	private String passw;
    	private String mes;
     
    public String getLog() {
    		return log;
    	}
    	public void setLog(String log) {
    		this.log = log;
    	}
    	public String getPassw() {
    		return passw;
    	}
    	public void setPassw(String passw) {
    		this.passw = passw;
    	}
     
    public String verifier()
    {
    	boolean verif=false;
    	SessionFactory sessionfactory = new Configuration().configure().buildSessionFactory();
    	Session session = sessionfactory.openSession();
    	try
    	{
    		Query q = session.createQuery("from Utilisateur");
    		Iterator it = q.iterate();
    		while (it.hasNext())
    		{
     
    			Utilisateur u = (Utilisateur)it.next();
    			if ((u.getId().contains(this.log))&& (u.getPassword().contains(passw)))
    			{
    				verif=true;
    			}
     
    		}
    	}
    	finally
    	{
    		session.close();
    	}
    	sessionfactory.close();
    	if (verif==true)
    	{
    		mes="";
    		return "ok";
    	}
    	else
    	{   mes ="Votre Login ou votre mot de passe est incorrecte veuillez verifier";
    		return "nok";
    	}
     
    }
    public void setMes(String mes) {
    	this.mes = mes;
    }
    public String getMes() {
    	return mes;
    }
     
    }
    la classe utilisteur generé par Hibernate est la suivante :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
     
    package stt;
     
    import stt.base.BaseUtilisateur;
     
     
     
    public class Utilisateur extends BaseUtilisateur {
    	private static final long serialVersionUID = 1L;
     
    /*[CONSTRUCTOR MARKER BEGIN]*/
    	public Utilisateur () {
    		super();
    	}
     
    	/**
             * Constructor for primary key
             */
    	public Utilisateur (java.lang.String id) {
    		super(id);
    	}
     
    	/**
             * Constructor for required fields
             */
    	public Utilisateur (
    		java.lang.String id,
    		java.lang.String password,
    		java.lang.Integer matricule,
    		java.lang.Integer profile) {
     
    		super (
    			id,
    			password,
    			matricule,
    			profile);
    	}
     
    /*[CONSTRUCTOR MARKER END]*/
    lorsque j'essaie de se connecter une exception se declanche :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
     
    exception 
     
    javax.servlet.ServletException: Error calling action method of component with id j_id_jsp_694048630_2:j_id_jsp_694048630_8
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
     
     
    cause m�re 
     
    javax.faces.FacesException: Error calling action method of component with id j_id_jsp_694048630_2:j_id_jsp_694048630_8
    	org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    	javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
     
     
    cause m�re 
     
    javax.faces.el.EvaluationException: org.hibernate.MappingException: could not instantiate id generator [entity-name=stt.Utilisateur]
    	javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
    	org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
    	javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
     
     
    cause m�re 
     
    org.hibernate.MappingException: could not instantiate id generator [entity-name=stt.Utilisateur]
    	org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:132)
    	org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
    	org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:224)
    	org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
    	bean.IdentifyUser.verifier(IdentifyUser.java:35)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	java.lang.reflect.Method.invoke(Method.java:585)
    	org.apache.el.parser.AstValue.invoke(AstValue.java:172)
    	org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    	org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
    	javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
    	org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
    	javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
     
     
    cause m�re 
     
    org.hibernate.MappingException: Dialect does not support sequences
    	org.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:619)
    	org.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:88)
    	org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:127)
    	org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
    	org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:224)
    	org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
    	bean.IdentifyUser.verifier(IdentifyUser.java:35)
    	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	java.lang.reflect.Method.invoke(Method.java:585)
    	org.apache.el.parser.AstValue.invoke(AstValue.java:172)
    	org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
    	org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:68)
    	javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
    	org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
    	javax.faces.component.UICommand.broadcast(UICommand.java:383)
    	javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
    	javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
    	com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
    	com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
    	com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
    	javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
    mes regles de navigation sont bien déclaré dans le facesconfig et j'ai pas pu identifier le probleme et voila les regles de navigation :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
     
    <navigation-rule>
       	<display-name>Identify</display-name>
       	<from-view-id>/Identify.jsp</from-view-id>
       	<navigation-case>
       		<from-outcome>ok</from-outcome>
       		<to-view-id>/Acceuil.jsp</to-view-id>
       	</navigation-case>
       </navigation-rule>
       <navigation-rule>
       	<display-name>Identify</display-name>
       	<from-view-id>/Identify.jsp</from-view-id>
       	<navigation-case>
       		<from-outcome>nok</from-outcome>
       		<to-view-id>/Identify.jsp</to-view-id>
       	</navigation-case>
       </navigation-rule>
    quelle rectification ouis je ajouter ?
    merci pour votre aide

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Citation Envoyé par Emir83 Voir le message
    mes regles de navigation sont bien déclaré dans le facesconfig et j'ai pas pu identifier le probleme
    merci pour votre aide
    Suffit de lire ton message d'erreur
    org.hibernate.MappingException: Dialect does not support sequences
    Tu utilise des sequences pour ton mapping, mais tu prend un dialect qui ne gère pas les séquences.

  3. #3
    Nouveau membre du Club
    Inscrit en
    Mars 2007
    Messages
    70
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 70
    Points : 27
    Points
    27
    Par défaut
    que dois faire donc pour ne pas utiliser des sequances ?

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    utilise autre chose pour la génértion de tes ID. La documentation d'hibernate contient la liste de tous les generateurs d'id possible et leur comportement respectif.

  5. #5
    Nouveau membre du Club
    Inscrit en
    Mars 2007
    Messages
    70
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 70
    Points : 27
    Points
    27
    Par défaut
    un lien stp

  6. #6
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806

  7. #7
    Nouveau membre du Club
    Inscrit en
    Mars 2007
    Messages
    70
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 70
    Points : 27
    Points
    27
    Par défaut
    j'ai modifié le mode de genration d'id de sequance a identity et ça marche impecable !!!

    merci Tchizzz

Discussions similaires

  1. Uploadify - Error calling method on NPObject!
    Par PseT34 dans le forum jQuery
    Réponses: 0
    Dernier message: 08/02/2011, 15h37
  2. [PHP 5.2] Fatal error: Call to undefined method DateTime::sub()
    Par made_in_france dans le forum Langage
    Réponses: 2
    Dernier message: 31/01/2011, 09h39
  3. Réponses: 1
    Dernier message: 03/08/2010, 10h17
  4. [DOM] Error calling method on NPObject! (QuickTime + DOM + Firefox)
    Par robmayol dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 18/12/2008, 17h38
  5. Réponses: 0
    Dernier message: 25/02/2008, 17h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo