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

Développement Web en Java Discussion :

pas de lancement de l'application


Sujet :

Développement Web en Java

  1. #81
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    bonjour,

    j'ai une erreur que je n'arrive pas à résoudre suite à tout ce que vous m'avez conseillé. Voici l'erreur :


    java.sql.SQLException: Data source rejected establishment of connection, message from server: "Host 'nom de mon poste 'is not allowed to connect to this MySQL server"
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:650)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1808)
    at com.mysql.jdbc.Connection.<init>(Connection.java:452)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at ecr_connexion.actionPerformed(ecr_connexion.java:53)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


    Voici une partie de mon code :

    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
     
    public void actionPerformed(ActionEvent arg0) {
    		// TODO Auto-generated method stub
    		String identifiant = id.getText().trim();
    		String motPasse = String.valueOf(mdp.getPassword());
     
    	     try 
    	     {
    			Class.forName("com.mysql.jdbc.Driver");
    	     } catch (ClassNotFoundException e2) {
    			// TODO Auto-generated catch block
    	    	 System.out.println("erreur de class forname");
    			e2.printStackTrace();
     
    	     }
    	     Connection con = null;
    	     ResultSet resultats = null;
    		try 
    		{
     
    			con = DriverManager.getConnection("jdbc:mysql://163.71.111.9/batonnage","root","");
    			Statement st = con.createStatement();
    			resultats = st.executeQuery("SELECT num_agent,mdp from agents where nni = '"+identifiant+"'");
    			boolean isEmpty = true ;
    			while (resultats.next()) {
    //				Si tu rentres une seule fois dans la boucle, le ResultSet n'est pas vide
    				isEmpty = false;
    				ecran.num_agent = resultats.getInt("num_agent");
    				System.out.println(ecran.num_agent);
    				System.out.println(resultats.getString("mdp"));
    				System.out.println(motPasse);
    				if (motPasse.equals(resultats.getString("mdp"))) {
     
    					fen.setVisible(false);
    					ecr_choix_act e = new ecr_choix_act();
    				} 
    				else {
    					JOptionPane.showMessageDialog(fen, "Vous n'avez pas saisi le bon mot de passe.", "Attention!", JOptionPane.WARNING_MESSAGE);
    				}
    			}
     
    			if(isEmpty){
    				//Insère ici tes lignes de code à exécuter si le ResultSet est vide
    				JOptionPane.showMessageDialog(fen, "Vous n'avez pas saisi votre NNI.", "Attention!", JOptionPane.WARNING_MESSAGE);
    			}
    			resultats.close();
    			st.close();
    			con.close();
    		}
    		catch (SQLException e1) {
    			// TODO Auto-generated catch block
    			System.out.println("erreur au moment de la connexion");
    			e1.printStackTrace();
    		}
     
    	}
    J'ai bien le message "erreur au moment de la connexion qui s'affiche", mais je n'arrive pas à résoudre le problème. J'ai essayé plusieurs syntaxe mais ça n'a rien changé

    Merci de m'avoir aidé jusqu'ici.

  2. #82
    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
    Suffit de lire le message d'erreur
    "Host 'nom de mon poste 'is not allowed to connect to this MySQL server"

  3. #83
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    oui, ça j'avais vu...mais je ne vois pas d'où cela peut venir je tourne en local

  4. #84
    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
    t'as les droit sur le serveur SQL, rien à voir avec java.

  5. #85
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    je suis l'admin. j'accède très bien à ma base via mon intranet, c'est pour ça que je comprends pas

  6. #86
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    est-ce que cela peut être lié à cette ligne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Class.forName("com.mysql.jdbc.Driver");
    j'ai créé un host utilisant le nom de mon poste, ça n'a rien changé. un utilisateur avec le nom de mon poste ça n'a rien changé non plus.

  7. #87
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    j'ai crée un utilisateur '%' et j'ai maintenant une erreur de type :

    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
    java.sql.SQLException: Invalid authorization specification message from server: "Access denied for user 'root'@'DOUTU242.ADDC01' (using password: NO)"
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2001)
    	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1907)
    	at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:2524)
    	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:818)
    	at com.mysql.jdbc.Connection.createNewIO(Connection.java:1808)
    	at com.mysql.jdbc.Connection.<init>(Connection.java:452)
    	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)
    	at java.sql.DriverManager.getConnection(DriverManager.java:512)
    	at java.sql.DriverManager.getConnection(DriverManager.java:171)
    	at ecr_choix_act.<init>(ecr_choix_act.java:20)
    	at ecr_connexion.actionPerformed(ecr_connexion.java:68)
    	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    	at java.awt.Component.processMouseEvent(Component.java:5100)
    	at java.awt.Component.processEvent(Component.java:4897)
    	at java.awt.Container.processEvent(Container.java:1569)
    	at java.awt.Component.dispatchEventImpl(Component.java:3615)
    	at java.awt.Container.dispatchEventImpl(Container.java:1627)
    	at java.awt.Component.dispatchEvent(Component.java:3477)
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    	at java.awt.Container.dispatchEventImpl(Container.java:1613)
    	at java.awt.Window.dispatchEventImpl(Window.java:1606)
    	at java.awt.Component.dispatchEvent(Component.java:3477)
    	at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    	at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    j'ai essayé en donnant tous les droits à '%', mais sans succès...

  8. #88
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    quelqu'un aurait-il une idée, je suis toujours bloquée sur la même erreur.

    Merci.

  9. #89
    Membre régulier
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    512
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France, Indre et Loire (Centre)

    Informations forums :
    Inscription : Juin 2007
    Messages : 512
    Points : 97
    Points
    97
    Par défaut
    problème résolu...j'ai refait mon user générique restart le serveur et ça fontionne...j'arrive aussi à charger mon appli d'un autre pc!

    Merci beaucoup de votre aide

+ Répondre à la discussion
Cette discussion est résolue.
Page 5 sur 5 PremièrePremière 12345

Discussions similaires

  1. Réponses: 13
    Dernier message: 20/05/2015, 21h11
  2. Réponses: 8
    Dernier message: 28/08/2010, 09h44
  3. Réponses: 0
    Dernier message: 25/05/2010, 16h55
  4. Icone dans barre taches napparait pas tjr(lancement session)
    Par souch dans le forum Composants VCL
    Réponses: 4
    Dernier message: 16/06/2004, 10h51
  5. Lancement d'une application en local (!)
    Par Fifoun dans le forum MFC
    Réponses: 5
    Dernier message: 12/06/2004, 17h09

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