Erreur que j'arrive pas à trouver en java
Résolu
luna
-
luna -
luna -
bonjour ,
j'ai une application en java sous eclipse qui consiste en l'envoi d'un email par le protocole SMTP j'utilise javamail 1.4.5 , je me connecte à une boite mail la connexion se fait normalement mais lors de l'envoi du mail des que je click sur le bouton envoyé j'ai des exceptions j'ai pas compri ou est le problème . voila ce que j'obtiens
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at javax.activation.FileDataSource.<init>(Unknown Source)
at EnvoiMail$2.actionPerformed(EnvoiMail.java:173)
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.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)
est ce que quelqu'un peut m'aider merci
j'ai une application en java sous eclipse qui consiste en l'envoi d'un email par le protocole SMTP j'utilise javamail 1.4.5 , je me connecte à une boite mail la connexion se fait normalement mais lors de l'envoi du mail des que je click sur le bouton envoyé j'ai des exceptions j'ai pas compri ou est le problème . voila ce que j'obtiens
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at javax.activation.FileDataSource.<init>(Unknown Source)
at EnvoiMail$2.actionPerformed(EnvoiMail.java:173)
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.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)
est ce que quelqu'un peut m'aider merci
A voir également:
- Erreur que j'arrive pas à trouver en java
- Waptrick java football - Télécharger - Jeux vidéo
- Jeux java itel - Télécharger - Jeux vidéo
- Trouver adresse mac - Guide
- Eclipse java - Télécharger - Langages
- Java apk - Télécharger - Langages
1 réponse
ce sont des erreurs qui arrive lorsque t'as pas fait un new sur un objet avant de l'utiliser.
dans ton fichier EnvoiMail.java sur la ligne 173; ya peut etre un attribut de la classe que tu manipule sans avoir fait le new dans le contructeur
dans ton fichier EnvoiMail.java sur la ligne 173; ya peut etre un attribut de la classe que tu manipule sans avoir fait le new dans le contructeur
luna
ok merci je v voir mon code
luna
aprés avoir verifier mon code j'ai pas trouvé d'attribut sans l'instanciation
ajp55
Messages postés
426
Date d'inscription
Statut
Membre
Dernière intervention
23
essaye de coller le contenu de cette classe sur le forum pour mieux voir ton problème.
KX
Messages postés
16761
Date d'inscription
Statut
Modérateur
Dernière intervention
3 020
Et surtout le code l'actionPerformed lorsque tu fais l'addActionListener de ton bouton, puisque c'est là que se déclenche l'erreur à cause d'un File mal instancié (un null en paramètre du constructeur ?)
luna
merci bcp j'ai trouvé mon erreur , mon code fait l'envoi d'un mail avec piece jointe et moi quand j'execute j'ajoute pas une piece jointe ,maintenant il marche merci bcp