2011-07-11 4 views
1

私は奇妙な問題を抱えています。リフトフレームワークを使用したJavaxメール

私はwebappをサーバー(jetty 7.4.3.v20110701)に配備しています。メーラを含むすべてのものが正常に動作しているようです。電子メールを送信するための情報を(-Djavax.activation.debug=trueとなった)デバッグすると、次のようになります。

その後、
MailcapCommandMap: createDataContentHandler for text/html 
    search DB #0 
    got content-handler 
     class com.sun.mail.handlers.text_html 
INFO [qtp1699297250-32] net.liftweb.util.TimeHelpers.info[195] - Service request (GET) /reservation/276 returned 200, took 264 Milliseconds 
INFO [qtp1699297250-34] net.liftweb.util.TimeHelpers.info[195] - Service request (GET) /ajax_request/liftAjax.js returned 200, took 9 Milliseconds 
MailcapCommandMap: createDataContentHandler for multipart/alternative 
    search DB #0 
    got content-handler 
     class com.sun.mail.handlers.multipart_mixed 

しかし、突然、どこからともなくコードだけで、作業を停止する:

Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception: 
java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed 
    search DB #1 
    search DB #2 
    search DB #3 
    search fallback DB #0 
    search fallback DB #1 
    got content-handler 
     class com.sun.mail.handlers.multipart_mixed 
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception: java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed 
    search fallback DB #2 
    got content-handler 
     class com.sun.mail.handlers.multipart_mixed 
Can't load DCH com.sun.mail.handlers.multipart_mixed; Exception: java.lang.ClassNotFoundException: com/sun/mail/handlers/multipart_mixed 
    search fallback DB #3 
ERROR [pool-3-thread-13] net.liftweb.util.MailerImpl.error[239] - Couldn't send mail 
javax.mail.MessagingException: IOException while sending message 
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1141) ~[mail-1.4.4.jar:1.4.4] 
    at javax.mail.Transport.send0(Transport.java:189) ~[mail-1.4.1.jar:1.4.1] 
    at javax.mail.Transport.send(Transport.java:118) ~[mail-1.4.1.jar:1.4.1] 
    at net.liftweb.util.MailerImpl$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:180) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$$anon$1$$anonfun$$init$$1.apply(Mailer.scala:180) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$class.performTransportSend(Mailer.scala:174) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.Mailer$.performTransportSend(Mailer.scala:31) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$class.msgSendImpl(Mailer.scala:276) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.Mailer$.msgSendImpl(Mailer.scala:31) ~[lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:158) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$MsgSender$$anonfun$messageHandler$1.apply(Mailer.scala:155) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$class.execTranslate(LiftActor.scala:321) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.util.MailerImpl$MsgSender.execTranslate(Mailer.scala:154) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$proc2(LiftActor.scala:289) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$$anonfun$net$liftweb$actor$SpecializedLiftActor$$processMailbox$1.apply(LiftActor.scala:210) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$class.around(LiftActor.scala:224) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
     at net.liftweb.util.MailerImpl$MsgSender.around(Mailer.scala:154) [lift-util_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$class.net$liftweb$actor$SpecializedLiftActor$$processMailbox(LiftActor.scala:209) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.SpecializedLiftActor$$anonfun$2$$anonfun$apply$mcV$sp$1.apply$mcV$sp(LiftActor.scala:173) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at net.liftweb.actor.LAScheduler$$anonfun$9$$anon$2$$anon$3.run(LiftActor.scala:64) [lift-actor_2.9.0-1-2.4-M1.jar:2.4-M1] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_24] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_24] 
    at java.lang.Thread.run(Thread.java:662) [na:1.6.0_24] 
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/alternative; 
    boundary="----=_Part_8_877795714.1310372068000" 
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:877) ~[na:1.6.0_24] 
    at javax.activation.DataHandler.writeTo(DataHandler.java:302) ~[na:1.6.0_24] 
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1403) ~[mail-1.4.1.jar:1.4.1] 
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1745) ~[mail-1.4.1.jar:1.4.1] 
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1099) ~[mail-1.4.4.jar:1.4.4] 
    ... 23 common frames omitted 

をいくつかの時間後には、再び作業を開始することができます。

解決策を試しましたが、herehereをお勧めします。私はまたjavax.mail 1.4.11.4.4の両方を使ってjavax.activationを除いて試しました。いずれのソリューションも機能しませんでした。何が原因だろうか?どんな助けもありがたい。

答えて

0

私のpom.xmlにmail.jarとactivation.jar providedを作成することで修正できました。

 <dependency> 
     <groupId>javax.mail</groupId> 
     <artifactId>mail</artifactId> 
     <version>1.4.1</version> 
     <scope>provided</scope> 
     </dependency> 

コンテナにはすでにmail.jarがあり、jdk 1.6にactivation.jarが含まれていたと思います。

関連する問題