使用IMAP主机进行Jelastic邮件访问

时间:2014-04-20 12:54:20

标签: javamail imap java-server jelastic

我已将My Java服务器部署到Jelactic PaaS平台。该项目在localhost上工作正常,但它提供com.sun.mail.util.MailConnectException .... 任何解决方案请.... 在此先感谢..

异常的堆栈跟踪是:

com.sun.mail.util.MailConnectException: Couldn't connect to host, port: newmailhost.cc.iitk.ac.in, 993; timeout -1; nested exception is: java.net.UnknownHostException: newmailhost.cc.iitk.ac.in com.sun.mail.util.MailConnectException: Couldn't connect to host, port: newmailhost.cc.iitk.ac.in, 993; timeout -1; nested exception is: java.net.UnknownHostException: newmailhost.cc.iitk.ac.in at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:693) at javax.mail.Service.connect(Service.java:345) at javax.mail.Service.connect(Service.java:226) at Android.MainThread.uidChange(MainThread.java:69) at Android.MainThread.execute(MainThread.java:41) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: java.net.UnknownHostException: newmailhost.cc.iitk.ac.in at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) 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:301) at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:229) at com.sun.mail.iap.Protocol.(Protocol.java:116) at com.sun.mail.imap.protocol.IMAPProtocol.(IMAPProtocol.java:121) at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:710) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:659) ... 29 more

1 个答案:

答案 0 :(得分:0)

问题是您的邮件服务器没有发布正确的DNS记录。您可以在此处查看:http://dnsquery.org/dnsquery/newmailhost.cc.iitk.ac.in/ANY

检查您本地计算机上的主机文件 - 也许它有一个newmailhost.cc.iitk.ac.in条目,或者您在本地计算机上使用的主机名略有不同?

由于这是一个ac.in地址,另一种可能性是在您的大学网络中解决了这个问题,但它在外部无法使用。

如果您使用相应的IP地址替换主机名(例如,从您的计算机上检查),您可以从情况中删除DNS - 但如果无法通过Internet访问服务器,它仍然无法正常工作。