Mail Server Connection Failed With 'java.net.SocketException: Permission denied: connect.' Exception
症状
Mail server configuration fails with the following exception in atlassian-fisheye-YYYY-MM-DD.log
:
2014-12-02 10:44:29,856 ERROR [qtp1922315985-55427 -email-1417535069856] fisheye.mail Mailer-sendMessage - problem sending email
javax.mail.MessagingException: Could not connect to SMTP host: smtp.company.com, port: 25;
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
...
Caused by: java.net.SocketException: Permission denied: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:232)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1250)
... 161 more
原因
- This is a known bug in Java 7, as per this post.
- This can be caused by anti-virus or firewall software blocking Java from connecting to the SMTP port.
ソリューション
- Add
-Djava.net.preferIPv4Stack=true
to theFISHEYE_OPTS
environment variable to help enable support for IPv4 on Java 7. - Change the anti-virus or firewall software so that Java can connect to the SMTP server on the specified port.
最終更新日 2018 年 11 月 2 日
Powered by Confluence and Scroll Viewport.