java.net.SocketException when posting news.

"turiot" <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <000001c444b1$d45c3790$fae609c0@sturiotdell>
Hi all,
 
I have the following exception when I try to post news with the
nntp-post provider :
 
javax.mail.MessagingException: Socket closed;
  nested exception is: 
      java.net.SocketException: Socket closed
      at gnu.mail.providers.nntp.NNTPTransport.sendMessage(Unknown
Source)
      at com.lds.nntp.ClientPostNews.main(ClientPostNews.java:241)
Next exception:
java.net.SocketException: Socket closed
      at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)
      at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
      at gnu.inet.util.CRLFOutputStream.write(CRLFOutputStream.java:130)
      at gnu.inet.util.CRLFOutputStream.write(CRLFOutputStream.java:99)
      at gnu.inet.nntp.NNTPConnection.send(NNTPConnection.java:1233)
      at
gnu.inet.nntp.NNTPConnection.postComplete(NNTPConnection.java:610)
      at gnu.inet.nntp.PostStream.close(PostStream.java:63)
      at gnu.mail.providers.nntp.NNTPTransport.sendMessage(Unknown
Source)
      at com.lds.nntp.ClientPostNews.main(ClientPostNews.java:241)
 
I still haven't found anything about it, here's the code :
            
try
            {
                  // session
                  javax.mail.Session session =
javax.mail.Session.getInstance(System.getProperties(), null);
 
                  // create message
                  javax.mail.internet.MimeMessage message =
                        new javax.mail.internet.MimeMessage(session);
                  message.setFrom(new
javax.mail.internet.InternetAddress("[email protected]"));
                  javax.mail.Address[] recipients = { new
javax.mail.internet.NewsAddress("axa.system.rdbms.tempdb") };
 
message.setRecipients(javax.mail.internet.MimeMessage.RecipientType.NEWS
GROUPS,
                             recipients);
                  message.setSubject("Test");
                  message.setText("This is a test.", "iso-8859-1");
 
                  // get transport
                  javax.mail.URLName url = new
URLName("nntp-post://user:[email protected]:120");
                  javax.mail.Transport transport =
session.getTransport(url);
                  transport.connect();
                  transport.sendMessage(message,
message.getAllRecipients());
                  transport.close();
 
            }
            catch (MessagingException e)
            {
                  e.printStackTrace();
                  Exception e2 = e.getNextException();
                  if (e2!=null)
                  {
                        System.out.println("Next exception:");
                        e2.printStackTrace();
                  }
            }
 
Thanks for your help.
 
Regards
Seb.

_______________________________________________
Classpathx-javamail mailing list
[email protected]
http://mail.gnu.org/mailman/listinfo/classpathx-javamail
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.