Wildfly -9 javax.mail is not working

后端 未结 2 1028
半阙折子戏
半阙折子戏 2021-01-23 23:38

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          


        
相关标签:
2条回答
  • 2021-01-24 00:05

    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.

    0 讨论(0)
  • 2021-01-24 00:16

    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.

    0 讨论(0)
提交回复
热议问题