您好我正在尝试设置使用 gmail 服务器的邮件服务。但是,当我尝试运行测试时,出现以下异常。
09:48:35,334 ERROR [stderr] (Thread-1 (HornetQ-client-global-threads-31702353))
javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com,
port: 465;
09:48:35,335 ERROR [stderr] (Thread-1 (HornetQ-client-global-threads-31702353))
nested exception is:
09:48:35,335 ERROR [stderr] (Thread-1 (HornetQ-client-global-threads-31702353))
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.
SunCertPathBuilderException:unable to find valid certification path
to requested target
这是我在standalone-full.xml 中的配置
<mail-session jndi-name="java:/Mail">
<smtp-server ssl="true" outbound-socket-binding-ref="mail-smtp">
<login name="mygmailaccount@gmail.com" password="mypassword"/>
</smtp-server>
</mail-session>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="smtp.gmail.com" port="465"/>
</outbound-socket-binding>
我错过了什么吗?