2012-01-06 108 views
0

在此先感謝。我必須用春天發送郵件。當我嘗試代碼時,它在我的控制檯中顯示下面的Bean Exception。使用彈簧發送電子郵件?

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

我從來沒有見過這樣的東西,但例外似乎是說它試圖加載格式不正確的類文件javax.mail.MessagingException。我建議你下載一個包含該類的JAR文件的新副本,等等。

+0

@shiva - 你*仍然*得到這個異常?下載新版本是否可以解決問題? – 2012-01-06 04:30:46

+0

我在程序中下載了新的jar文件。仍然是同樣的錯誤到達。你是否想要再找到錯誤信息來找到這個問題? – shiva 2012-01-06 05:25:12

+0

非常感謝。我得到了輸出。我可以將郵件從指定的SMTP發送給其他人。 – shiva 2012-01-07 11:39:41