我在我的应用程序中使用Wildfly 9.0.0 Final和javax.mail api
。
我收到以下日志:
2015-07-27 15:08:16,318 CONFIG [javax.mail] (default task-17) Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
2015-07-27 15:08:16,318 CONFIG [javax.mail] (default task-17) Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
2015-07-27 15:08:16,319 CONFIG [javax.mail] (default task-17) successfully loaded resource: /META-INF/javamail.default.address.map
2015-07-27 15:08:16,340 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) TO : jobseeker403@gmail.com
2015-07-27 15:08:16,341 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) ccAddresses :
2015-07-27 15:08:16,341 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) bccAddresses :
2015-07-27 15:08:16,341 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) messagesender : support@smarthires.com
2015-07-27 15:08:16,341 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) I subjectFriend recommends "Admin" opening at "ALECTO HEALTHCARE"
2015-07-27 15:08:16,346 DEBUG [class com.bodhtree.nexus.util.mail.Mail] (default task-17) Message: javax.mail.internet.MimeMessage@6be2cbe7
2015-07-27 15:08:16,357 FINE [javax.activation] (default task-17) MailcapCommandMap: load HOME
2015-07-27 15:08:16,359 FINE [javax.activation] (default task-17) new MailcapFile: file C:\Users\kiran.MAHATHI\.mailcap
2015-07-27 15:08:16,360 FINE [javax.activation] (default task-17) MailcapCommandMap: load SYS
2015-07-27 15:08:16,360 FINE [javax.activation] (default task-17) new MailcapFile: file C:\Program Files\Java\jdk1.8.0_45\jre\lib\mailcap
2015-07-27 15:08:16,360 FINE [javax.activation] (default task-17) MailcapCommandMap: load JAR
2015-07-27 15:08:16,362 FINE [javax.activation] (default task-17) MailcapCommandMap: getResources
2015-07-27 15:08:16,362 FINE [javax.activation] (default task-17) MailcapCommandMap: URL vfs:/C:/Work/wildfly-9.0.0.Final/bin/content/SmarthiresMaven.war/WEB-INF/lib/mail-1.4.jar/META-INF/mailcap
2015-07-27 15:08:16,363 FINE [javax.activation] (default task-17) new MailcapFile: InputStream
2015-07-27 15:08:16,364 FINE [javax.activation] (default task-17) parse: text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain
2015-07-27 15:08:16,364 FINE [javax.activation] (default task-17) Type: text/plain
2015-07-27 15:08:16,364 FINE [javax.activation] (default task-17) Command: content-handler, Class: com.sun.mail.handlers.text_plain
2015-07-27 15:08:16,364 FINE [javax.activation] (default task-17) parse: text/html;; x-java-content-handler=com.sun.mail.handlers.text_html
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) Type: text/html
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) Command: content-handler, Class: com.sun.mail.handlers.text_html
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) parse: text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) Type: text/xml
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) Command: content-handler, Class: com.sun.mail.handlers.text_xml
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) parse: multipart;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed; x-java-fallback-entry=true
2015-07-27 15:08:16,365 FINE [javax.activation] (default task-17) Type: multipart
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) Command: content-handler, Class: com.sun.mail.handlers.multipart_mixed
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) parse: message/rfc822;; x-java-content-handler=com.sun.mail.handlers.message_rfc822
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) Type: message/rfc822
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) Command: content-handler, Class: com.sun.mail.handlers.message_rfc822
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) MailcapCommandMap: successfully loaded mailcap file from URL: vfs:/C:/Work/wildfly-9.0.0.Final/bin/content/SmarthiresMaven.war/WEB-INF/lib/mail-1.4.jar/META-INF/mailcap
2015-07-27 15:08:16,366 FINE [javax.activation] (default task-17) MailcapCommandMap: load DEF
2015-07-27 15:08:16,367 FINE [javax.activation] (default task-17) new MailcapFile: InputStream
2015-07-27 15:08:16,367 FINE [javax.activation] (default task-17) parse: image/gif;; x-java-view=com.sun.activation.viewers.ImageViewer
2015-07-27 15:08:16,367 FINE [javax.activation] (default task-17) Type: image/gif
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) Command: view, Class: com.sun.activation.viewers.ImageViewer
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) parse: image/jpeg;; x-java-view=com.sun.activation.viewers.ImageViewer
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) Type: image/jpeg
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) Command: view, Class: com.sun.activation.viewers.ImageViewer
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) parse: text x-java-view=com.sun.activation.viewers.TextViewer
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) Type: text
2015-07-27 15:08:16,368 FINE [javax.activation] (default task-17) Command: view, Class: com.sun.activation.viewers.TextViewer
2015-07-27 15:08:16,370 FINE [javax.activation] (default task-17) parse: text x-java-edit=com.sun.activation.viewers.TextEditor
2015-07-27 15:08:16,371 FINE [javax.activation] (default task-17) Type: text
2015-07-27 15:08:16,371 FINE [javax.activation] (default task-17) Command: edit, Class: com.sun.activation.viewers.TextEditor
2015-07-27 15:08:16,371 FINE [javax.activation] (default task-17) Merging commands for type text
2015-07-27 15:08:16,372 FINE [javax.activation] (default task-17) MailcapCommandMap: successfully loaded mailcap file: /META-INF/mailcap.default
2015-07-27 15:08:16,372 FINE [javax.activation] (default task-17) MailcapCommandMap: createDataContentHandler for text/html
2015-07-27 15:08:16,372 FINE [javax.activation] (default task-17) search DB #1
2015-07-27 15:08:16,373 FINE [javax.activation] (default task-17) got content-handler
2015-07-27 15:08:16,373 FINE [javax.activation] (default task-17) class com.sun.mail.handlers.text_html
2015-07-27 15:08:16,385 FINE [javax.mail] (default task-17) getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
2015-07-27 15:08:16,448 FINE [com.sun.mail.smtp] (default task-17) need username and password for authentication
2015-07-27 15:08:16,449 FINE [com.sun.mail.smtp] (default task-17) useEhlo true, useAuth true
2015-07-27 15:08:16,450 FINE [com.sun.mail.smtp] (default task-17) trying to connect to host "smtp.gmail.com", port 465, isSSL false
2015-07-27 15:09:24,610 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar
2015-07-27 15:09:34,613 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar
2015-07-27 15:11:34,620 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar
2015-07-27 15:11:44,621 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node identifier 1 to EJB receiver with node name kirankumar
我在我的应用程序中没有使用任何类型的EJB。并尝试使用Wildfly 8.2.0及其作品。但我的申请需要Wildfly 9。 我找不到导致这个问题的原因。
答案 0 :(得分:2)
最后我发现是因为Wildfly9.0.0.Final中的邮件模块。我们可以这样做作为临时解决方案。它对我有用。
从<wildfly-9.0.0.Final-Home>\standalone\configuration
发布以下内容
<subsystem xmlns="urn:jboss:domain:mail:2.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
</subsystem>
使用
<subsystem xmlns="urn:jboss:domain:mail:2.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
</mail-session>
</subsystem>
现在从<wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
替换以下行
<resource-root path="javax.mail-1.5.3.jar"/>
用
<resource-root path="javax.mail-1.5.1.jar"/>
复制“javax.mail-1.5.1.jar”表格
<wildfly-8.2.0.Final -Home>\modules\system\layers\base\javax\mail\api\main
要
<wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
并删除“javax.mail-1.5.3.jar”
来自
<wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
然后重启服务器。它对我有用。
答案 1 :(得分:0)
您正尝试在端口465上连接到smtp.gmail.com,这是一个SSL端口,但JavaMail认为您不想使用SSL。您可能在SSL协议协商中失败了。您正在为正在使用的JavaMail会话设置配置的方式有问题。