Java7ã¨JavaMail
Java7ã§JavaMailã使ãã¨ã以ä¸ã®ãããªã¨ã©ã¼ã§SMTPãµã¼ãã¸ã®æ¥ç¶ã失æãã¾ãã
javax.mail.MessagingException: Could not connect to SMTP host: 192.168.151.201, port: 25;
nested exception is:
java.net.SocketException: Network is unreachable: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
at javax.mail.Service.connect(Service.java:275)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
...Caused by: java.net.SocketException: Network is unreachable: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
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:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
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)
... 11 more
ãªããLinuxãã·ã³ã§ã¯ã¨ã©ã¼ãåºããWindowsãã·ã³ã§ã®ã¿çºçã
念ã®ããtelnetã§SMTPãåã£ã¦ã¿ãããæ£ããæ¥ç¶ã§ããã
調ã¹ã¦ã¿ãã以ä¸ã®è¨äºãè¦ã¤ãã¾ããã
Java Mail mystery - SMTP blocked?
http://stackoverflow.com/questions/14064111/java-mail-mystery-smtp-blocked
ã©ããJava7ã«ãªã£ã¦ãããIPv6ã®ãããã¯ã¼ã¯ã¢ããã¿ãåå¨ããå ´åã«ãã£ã¡ãåªå çã«ä½¿ããã¨ããããã§ãããWindowsã¯XPã®é ããIPv6ãããã©ã«ãã§ï¼ä½¿ã£ã¦ãªãã¦ãï¼è¨å®ããã¾ãããã
Javaã®èµ·åãªãã·ã§ã³ã§
-Djava.net.preferIPv4Stack=true
ãæå®ãããã¨ã§è§£æ±ºã
ã¾ãã¯ãããã°ã©ã å ãã以ä¸ãå¼ã³åºããã¨ã§ãåãçµæãå¾ãããããã§ãã
System.setProperty("java.net.preferIPv4Stack", "true");
- ä½è : Elliotte Rusty Harold
- åºç社/ã¡ã¼ã«ã¼: O'Reilly Media
- çºå£²æ¥: 2013/07/23
- ã¡ãã£ã¢: Kindleç
- ãã®ååãå«ãããã°ãè¦ã
- ä½è : æ¨ä¸ä¿¡
- åºç社/ã¡ã¼ã«ã¼: ç§åã·ã¹ãã
- çºå£²æ¥: 2001/03
- ã¡ãã£ã¢: åè¡æ¬
- è³¼å ¥: 1人 ã¯ãªãã¯: 3å
- ãã®ååãå«ãããã° (2件) ãè¦ã