使用spring发送电子邮件?

时间:2012-01-06 03:39:55

标签: spring email

提前致谢。我必须使用弹簧发送邮件。当我尝试代码时,它在我的控制台中显示Bean异常。

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: 
  Error creating bean with name 'mailSender' defined in class path resource [mail-simple.xml]:
  Instantiation of bean failed; 
  nested exception is java.lang.ClassFormatError: Absent Code attribute in method that 
      is not native or abstract in class file javax/mail/MessagingException.

  Caused by: java.lang.ClassFormatError: Absent Code attribute in method that 
      is not native or abstract in class file javax/mail/MessagingException

有人可以帮我找到这个问题吗?

1 个答案:

答案 0 :(得分:1)

我从来没有见过这样的东西,但异常似乎是说它正在尝试为javax.mail.MessagingException加载格式错误的类文件。我建议你下载一个包含该类的JAR文件的新副本,等等。