-
1. Re: 4.05GA javamail problem
dimitris Oct 23, 2006 11:06 AM (in response to bezdomny)Can you post the full stacktrace?
-
2. Re: 4.05GA javamail problem
bezdomny Oct 23, 2006 12:04 PM (in response to bezdomny)Hey Dimitris,
I would if I could, but as soon as the MimeMessage(mailSession) constructor is called and InvocationTargetException is thrown, then I see the java.lang.NoClassDefFoundError: com/sun/mail/util/SharedByteArrayInputStream
Here is my method:
public void sendMessage() {
try {
Session mailSession = null;
try {
Context ctx = new InitialContext();
Object objref = ctx.lookup("java:/Mail");
mailSession = (Session) PortableRemoteObject.narrow(objref, Session.class);
} catch (NamingException e) {
System.out.println(e);
e.printStackTrace();
}
MimeMessage msg = new MimeMessage(mailSession);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setFrom();
msg.setRecipients(Message.RecipientType.TO, getAddresses());
msg.setText(mailMessage);
Transport.send(msg);
}
catch (MessagingException e) {
logger.log(Level.SEVERE, "messaging error: ", e);
}
}
Bob -
3. Re: 4.05GA javamail problem
dimitris Oct 23, 2006 12:51 PM (in response to bezdomny)Do you happen to have any duplicate version of mail.jar in your deployment?
-
4. Re: 4.05GA javamail problem
bezdomny Oct 23, 2006 3:10 PM (in response to bezdomny)Yep That was it. I'm using a third party jar that has some of the old sun/* classes included. When I removed that, my problem was solved. Thanks for the help.
B