• Post Reply Bookmark Topic Watch Topic
  • New Topic

error connecting to JavaMail Server

 
geeu mom
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends ..
am new to java mail..
i try to execute the java mail demo program...i installed smtp mail server to machine(localhost).. when i execute the program am getting an error in " connect exception"
java.mail.MessageException...

am using weblogic so i created properly sessions in WebLogic Server"
its not showing any error.....

here am mentioned as small part of connection...

inMailServer : Am Installed SMTP server in my System so gave "localhost"
user :ashok_m (valid user ID)
password vald password)


URLName url = new URLName("imap", inMailServer, -1, "INBOX",
user, password);

try
{
InitialContext ic = new InitialContext();
//Context ctx = (Context)ic.lookup("java:comp/env");
session = (Session)ic.lookup("MySession");
System.out.println("Session Initialized : MailUserBean");
}
catch (Exception ex)
{
// ignore it
}
store = session.getStore(url);
store.connect();

when i connect that time only its giving error..
the error msg is...........
========================================================
javax.mail.MessagingException: Connection timed out: connect;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:298)
at javax.mail.Service.connect(Service.java:234)
at javax.mail.Service.connect(Service.java:135)
at javax.mail.Service.connect(Service.java:87)
at mails.MailBean.login(MailBean.java:61)
at jsp_servlet.__mainpage._jspService(__mainpage.java:162)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!