Bonjour, je suis en train de faire en interface graphique ce qui fonctionnait très bien en mode console et j'ai une erreur de type ConnectionException lorsque j'instancie un objet alors que je lui donne les bon paramètres et les bon types, je vous montre mon code:
Et le constructeur:String user = userJText.getText();
String mdp = mdpJText.getText();
String host = hostJText.getText();
int port = Integer.parseInt(portJText.getText()) ;
pop = new PopClient(host , port);
Je lui donne bien un String et un int que je récupère bien et l'erreur vient du host apparemment..public PopClient(String host, int port)
{
this.sock = new ClientSocket(host , port);
}
Voici l'erreur en entière:
D'où provient l'erreur svp?Exception in thread "AWT-EventQueue-0" app.ConnectionException: Connexion impossible : ytytrytr
at app.ClientSocket.open(ClientSocket.java:69)
at app.ClientSocket.<init>(ClientSocket.java:52)
at app.PopClient.<init>(PopClient.java:29)
at app.Interface$1.actionPerformed(Interface.java:97)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
je précise que c'est une application graphique d'un serveur popclient et que je m'arrête à l'instanciation de l'objet (la suite du code est en commentaire comme ce n'est pas encore fini), peut-être que tout est bon mais que ca me met une erreur comme je n'ai pas lancé de serveur pop?
Partager