I am making use of Wildfly 9.0.0 Final and javax.mail api
in my application.
I am getting the following log:
2015-07-27 15:08:16,318 CONFIG
Finally I found it is because of mail module in Wildfly9.0.0.Final. We can do this as temporary solution.And it works for me.
Open standalone-ha.xml from <wildfly-9.0.0.Final-Home>\standalone\configuration
Releace the following
<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>
With
<subsystem xmlns="urn:jboss:domain:mail:2.0">
<mail-session name="default" jndi-name="java:jboss/mail/Default">
</mail-session>
</subsystem>
Now open “module.xml” from <wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
Replace the following line
<resource-root path="javax.mail-1.5.3.jar"/>
With
<resource-root path="javax.mail-1.5.1.jar"/>
And copy the “javax.mail-1.5.1.jar” form
<wildfly-8.2.0.Final -Home>\modules\system\layers\base\javax\mail\api\main
To
<wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
And remove “javax.mail-1.5.3.jar”
from the
<wildfly-9.0.0.Final-Home>\modules\system\layers\base\javax\mail\api\main
And restart the server. It works for me.
You're trying to connect to smtp.gmail.com on port 465, which is an SSL port, but JavaMail doesn't think you want to use SSL. You're probably failing in the SSL protocol negotiation. Something is wrong with how you're setting the configuration for the JavaMail Session that you're using.