Unknown SMTP host exception...

Hi all...
am a newbie in j2ee...i have to send mails from my application...
have written the code...but it gives an error like the smtp host specified, is
unknown...
can anyone pleaz tell me what r the things to be set up or what r the configurations to be done to send a mail using program...am using Transport.send(message) function to do it...plz help me...
thanx and regards,
sand...

Hi,
As mentioned in the debugging steps, I turned the debugging session on by "session.setDebug(true);".I got the following printed on my console:
DEBUG: setDebug: JavaMail version 1.4ea
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 25, isSSL false
MessagingException
javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;
nested exception is:
     java.net.UnknownHostException: smtp.gmail.com
     at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280)
     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)
     at sendMail.main(sendMail.java:28)
Caused by: java.net.UnknownHostException: smtp.gmail.com
     at java.net.PlainSocketImpl.connect(Unknown Source)
     at java.net.SocksSocketImpl.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     at java.net.Socket.connect(Unknown Source)
     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)
     ... 7 more
I also tried to use telnet to connect as
telnet smtp.gmail.com 25
Here I got an output like
Connecting To smtp.gmsil.com...Could not open connection to the host, on port 25
: Connect failed
so now I donot understand wher the problem lies actually.
Can you please suggest anything?
Thanks

Similar Messages

  • Getting nested exception(Unknown SMTP host)

    hello
    i have written a simple mailclient.i am running the following programme from my local machine which is under proxy server.
    public class MailExample {
    public static void main (String args[]) throws Exception {
    String host = "mail.ab";
    String from = "[email protected]";
    String to = "[email protected]";
    Properties props = System.getProperties();
    props.put("mail.smtp.host", host);
    Session session = Session.getDefaultInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO,
    new InternetAddress(to));
    message.setSubject("Hello JavaMail");
    message.setText("Welcome");
    Transport.send(message);
    This host is some other machine.
    i am getting nested exception as unknown SMTP host.
    please help.
    thanks in advance

    Unknown host: it is telling you that it can't find the host you told it to look for. Either you gave it the name of a system that does not exist, or that system does not have an SMTP host running on it. I would guess the first reason, as "mail.ab" does not look right to me. (What country is "ab" and why is there only one mail server in the entire country?)

  • Javax.servlet.ServletException: Unknown SMTP host

    Hi
    I am using tomcat and trying to send emails. I keep getting a javax.servlet.ServletException: Unknown SMTP host error.
    I initially thought the problem was with the line: props.put("mail.smtp.host", "makethegrade.co.za"); But i checked the smtp info with the guys i'm hosing with and they said its right
    I am currently setting the fields manually, so it can't be a problem with passing data around in the webpage
    In my WEB-INF/lib i have jaf-1.0.2 and javamail-1.4.1 (i.e. mail.jar and activation.jar)
    The code for my mailer bean is:
    package mailer;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public final class MailerBean extends Object implements Serializable {
         /* Bean Properties */
         private String to = null;
         private String from = null;
         private String subject = null;
         private String message = null;
         public static Properties props = null;
         public static Session session = null;
         static {
              /*     Setting Properties for STMP host */
              props = System.getProperties();
              props.put("mail.smtp.host", "makethegrade.co.za");
              session = Session.getDefaultInstance(props, null);
         /* Setter Methods */
         public void setTo(String to) {
              this.to = to;
         public void setFrom(String from) {
              this.from = from;
         public void setSubject(String subject) {
              this.subject = subject;
         public void setMessage(String message) {
              this.message = message;
         /* Sends Email */
         public void sendMail() throws Exception {
              if(!this.everythingIsSet())
                   throw new Exception("Could not send email.");
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setRecipient(Message.RecipientType.TO,
                        new InternetAddress(this.to));
                   message.setFrom(new InternetAddress(this.from));
                   message.setSubject(this.subject);
                   message.setText(this.message);
                   Transport.send(message);
              } catch (MessagingException e) {
                   throw new Exception("Caught in sendMail" + e.getMessage());
         /* Checks whether all properties have been set or not */
         private boolean everythingIsSet() {
              if((this.to == null) || (this.from == null) ||
                 (this.subject == null) || (this.message == null))
                   return false;
              if((this.to.indexOf("@") == -1) ||
                   (this.to.indexOf(".") == -1))
                   return false;
              if((this.from.indexOf("@") == -1) ||
                   (this.from.indexOf(".") == -1))
                   return false;
              return true;
    }and the error i get is:
    org.apache.jasper.JasperException: Exception in JSP: /processingPages/mailer.jsp:17
    14:           mailer.setFrom("[email protected]");
    15:           mailer.setSubject("mailer test");
    16:           mailer.setMessage("TEst test test");
    17:           mailer.sendMail();
    18:           
    19:      %>
    20: </jsp:useBean>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    root cause
    javax.servlet.ServletException: Unknown SMTP host: mail.yourisp.com
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.processingPages.mailer_jsp._jspService(mailer_jsp.java:89)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    root cause
    java.lang.Exception: Unknown SMTP host: mail.yourisp.com
         mailer.MailerBean.sendMail(MailerBean.java:54)
         org.apache.jsp.processingPages.mailer_jsp._jspService(mailer_jsp.java:67)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    Tomcat logs give:
    Jul 15, 2009 10:50:35 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.Exception: Unknown SMTP host: mail.yourisp.com
         at mailer.MailerBean.sendMail(MailerBean.java:54)
         at org.apache.jsp.processingPages.mailer_jsp._jspService(mailer_jsp.java:67)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
         at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
         at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
         at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
         at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
         at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Thread.java:619)
    If anyone needs any other details feel free to ask.
    Any help or any pointers to a place to find a solution would be deeply appreciated
    Thanks

    All I can see is that you are running this in a web application. In most web application containers there's a place where you configure your mail providers and mail sessions. You seem to be ignoring that (you aren't using JNDI to get a session for example) but you are getting the default instance, so perhaps that uses that configuration anyway.

  • MessagingException "Unknown SMTP host"

    Hi
    I am using JavaMail to send out emails from an ecommerce application. We are now deploying the application and are getting the following message....
    nested exception is:
    class javax.mail.MessagingException: Unknown SMTP host: smtp.thehost.com ;
    nested exception is:
    java.net.UnknownHostException: smtp.thehost.com
    (note the server name is not actually smtp.thehost.com) - ive used that one here for confidentality.
    If i try to telnet to smtp.thehost.com on port 25 i get the expected 220 and everything seems fine. Its like JavaMail cant see the mailhost when everything else can.
    I am using :
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
    Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
    on Redhat.
    Any suggestions?
    Regards
    Lawrence

    If i try to telnet to smtp.thehost.com on port 25 i get the expected 220 and everything seems fine. Its like JavaMail cant see the mailhost when everything else can.This suggests that you aren't telling JavaMail the right host name. It looks to me as if it has an unnecessary space at the end, but at any rate check your code.

  • Hello, javax.mail.MessagingException: Unknown SMTP host:

    Hello,
    I am trying to send a mail and use a smtp Server which is located on the internet. I am however behind a firewall and am getting the following exception being thrown:
    javax.mail.MessagingException: Unknown SMTP host:
    This implies that I need to provide some settings for my proxy server. I though to solve this problem I could do the following:
    System.getProperties().put("proxySet", "true");
    System.getProperties().put("http.proxyHost", proxyHost);
    System.getProperties().put("http.proxyPort", proxyport);
    This however does not solve me problem as I still get the above exception. Could someone please give help me. Any suggestions,solutions or ideas as to what the problem might be would be appreciated.
    Thanks much,
    Alex.

    HTTP is not SMTP.
    Your proxy server no doubt allows your system to send
    HTTP traffic to and from the outside world, and using
    that code you posted would allow Java classes to do
    that as well. But HTTP is not SMTP. Ask the network
    people who configured your proxy server if it can act
    as an SMTP proxy, and if so what you have to do to
    use it in that way.Thanks much for your reply. I am however a little confused. Could you explain to me exactly what an SMTP proxy is/does.
    Thanks much,
    Alex.

  • Unknown smtp host

    Is it necessary to have Exchange server on the pc in which u r making a web application
    having email option...?
    Tomcat is giving this error although i have provided the mail server ip as follows...
    Properties props = new Properties();
    props.put("mail.smtp.host", 192.168.0.2);
    Session s = Session.getInstance(props,null);
    Urgent....

    Help me please.........

  • Getting exception: Unknown SMTP-- after running the following

    Dear Sir,
    I am running the demo example of the javamail api but I am getting the following message.
    D:\Sots\Java\javamail-1.3.3_01\demo>java msgsend -o [email protected] -M SMTP.Server [email protected]
    To: [email protected]
    Subject: Hi
    Welcome
    ^Z
    javax.mail.MessagingException: Unknown SMTP host: SMTP.Server;
    nested exception is:
    java.net.UnknownHostException: SMTP.Server
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1225)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:32
    2)
    at javax.mail.Service.connect(Service.java:236)
    at javax.mail.Service.connect(Service.java:137)
    at javax.mail.Service.connect(Service.java:86)
    at javax.mail.Transport.send0(Transport.java:150)
    at javax.mail.Transport.send(Transport.java:80)
    at msgsend.main(msgsend.java:165)
    Thanks and Regards.
    Narendra Mohan

    Dear Sir,
    I am running the demo example of the javamail api but I am getting the following message.
    D:\Sots\Java\javamail-1.3.3_01\demo>java msgsend -o [email protected] -M SMTP.Server [email protected]
    To: [email protected]
    Subject: Hi
    Welcome
    ^Z
    javax.mail.MessagingException: Unknown SMTP host: SMTP.Server;
    nested exception is:
    java.net.UnknownHostException: SMTP.Server
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1225)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:32
    2)
    at javax.mail.Service.connect(Service.java:236)
    at javax.mail.Service.connect(Service.java:137)
    at javax.mail.Service.connect(Service.java:86)
    at javax.mail.Transport.send0(Transport.java:150)
    at javax.mail.Transport.send(Transport.java:80)
    at msgsend.main(msgsend.java:165)
    Thanks and Regards.
    Narendra Mohan

  • Smtp.host error

    i got some error msg
    error - javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com; nested exception is: java.net.UnknownHostException: smtp.gmail.com
    code                Properties props = new Properties();
                    props.put("mail.smtp.host", "smtp.gmail.com");
                    props.put("mail.smtp.port", "465");
                    props.put("mail.user","dineshjweerakkody");
                    Session mailSession = Session.getDefaultInstance(props, null);
                    MimeMessage msg = new MimeMessage(mailSession);
                    msg.setFrom(new    InternetAddress(request.getParameter("mymail"),request.getParameter("myname")));
                    msg.addRecipient(Message.RecipientType.TO,new InternetAddress(request.getParameter("resmail"),request.getParameter("resname")));
                    msg.setSubject(request.getParameter("subject"));
                    msg.setText(request.getParameter("message"));
                    Transport.send(msg);
                    response.sendRedirect("success.jsp");
                    Please help me...............

    See the JavaMail FAQ for tips on debugging connection problems.

  • Javamail smtp.host value for gmail

    my email account created on gmail.
    i want to create mailing site.
    now i got some error massage
    "Unknown SMTP host: smtp.gmail.com:465"
    Please tell me what is the smtp.host value for gmail

    Don't put the port number in the host name.
    See the JavaMail FAQ for how to connect to gmail.

  • Tunneling and problem with unknown host exception

    hello! i've got a problem with https. i use jdk 1.5.0, jboss-4.0.4.ga-patch1, soap.
    and i'm going crasy.. i've testet my client code at our network and it works fine. but if i want to get jobs from the server of our customer, my client throw an "unknown host exception: firm".
    i wonder why it hasn't the full host. the url may look like this: https://firm.sub.com:443/ and while the client connects to the server, i depugged it and the host is correct: firm.sub.
    but after the connection, when the client want to get something from the server (when it wants to communicate with the server over soap) it crashs.
    my client code looks like this:
    private ClientInterfaceEndpoint getClientInterface() throws ServiceException {
    QName serviceQName = new QName(DOCSERVER_NAMESPACE, CLIENT_INTERFACE_SERVICENAME);
    URL wsdlUrl = getClientInterfaceWsdlUrl();
    log.info("*******WSDLURL host: " + wsdlUrl.getHost()); // out: firm.sub
    log.info("*******WSDLURL port: " + wsdlUrl.getPort()); // out: 443
    URL mapping = getClass().getClassLoader().getResource("META-INF/DocumentServer_Mapping.xml");
    log.info("*******MappingURL path: " + mapping.getPath());
    if (wsdlUrl.toString().toLowerCase().contains("https")) {
    if (null == getConfig().getTruststore() || getConfig().getTruststore().equalsIgnoreCase("")) {
    throw new RuntimeException("No or incorrect TruststorePath in the docclient-config");
    File tmp = new File(getConfig().getTruststore());
    if (!tmp.isFile() || !tmp.canRead()) {
    throw new RuntimeException("The truststore at the 'TruststorePath' isn't a file or can't be read.");
    System.setProperty(SYS_PROPERTY_KEY_TRUST, getConfig().getTruststore());
    System.setProperty(SYS_PROPERTY_KEY_TRUST_PW, config.getTruststorePass());
    ServiceFactoryImpl factory = null;
    factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
    Service clientInterfaceService = null;
    try {// create the service for the ClientInterface
    clientInterfaceService = factory.createService(wsdlUrl, serviceQName, mapping, new URL(config.getServerURL())); //, new URL(config.getServerURL())
    log.info("*******ClientInterFaceService WSDL URL Host: " + clientInterfaceService.getWSDLDocumentLocation().getHost()); // out:firm.sub
    log.info("*******ClientInterFaceService WSDL URL Port: " + clientInterfaceService.getWSDLDocumentLocation().getPort()); // out: 443
    } catch (ServiceException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (MalformedURLException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    }// getting the ClientInterfaceEndpoint
    ClientInterfaceEndpoint clientInterface = (ClientInterfaceEndpoint) clientInterfaceService.getPort(ClientInterfaceEndpoint.class);
    return clientInterface;
    protected URL getClientInterfaceWsdlUrl() {
    URL url = null;
    String urlString = getConfig().getServerURL() + CLIENT_INTERFACE_URI + "?wsdl";
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty(SYS_PROPERTY_KEY_PKGS);
    if (handlers == null) {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS);
    else {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS.concat("|").concat(handlers));
    try {
    url = new URL(urlString);
    log.info("*******URL host: " + url.getHost());
    log.info("*******URL port: " + url.getPort());
    log.info("*******URL path: " + url.getPath());
    } catch (MalformedURLException e) {
    log.fatal("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString);
    throw new RuntimeException("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString, e);
    System.setProperties(properties);
    return url;
    }if it's usefull: the customer use a apache server (not tomcat) where a the server is and the client at another system the jboss.
    The customer told me: if i want to connect the client via http i have to tunnel.. maybe i have to tunnel using https too?
    have i to generate the endpoint classes a second time, extra for https?
    or doesn't soap like host like "firm.sub"?
    can anyone help me please?!
    sorry, my english isn't very well...

    sorry, it's not the same error. The output is: Unable to connect to any host due to exception: java.net.socket.exception: java.net.socket.exception: Unregcognized windows socket error: 10106: create.

  • InetAddress posting Unknown Host Exception

    Hello,
    I am relatively new to java and I am running into an Unknown Host Exception when attempting to return the IP's for valid host names. The strange part is that the first host name returns an address however every entry after the first returns the Unkown Host Exception. Here is the snippet of code that the problem is occuring in.
    Inet address as declared earlier in the code:
         private InetAddress Address = null;Code reporting errors:
              StringBuffer sb0 = new StringBuffer();
              int chr;
              // Read until the end of the stream     
              while ((chr = inputStream0.read()) != -1)
                      sb0.append((char) chr);
              String display = sb0.toString();
              String temp = display.replace("Giant ", "g0");
              String[] words = temp.split("\\|");
              StringBuffer db = new StringBuffer();
              for (int i=0; i < words.length; i++)
                      String many = (words[i] +"wu1");
                      try
                              Address = InetAddress.getByName(many);
                   db.append(words[i] + "wu1|" + Address);
                      catch(NullPointerException e)
                              db.append(words[i] + "wu1 - Null Pointer - ");
                      catch(UnknownHostException e)
                              db.append(words[i] + "wu1 - Unknown Host - ");
              String yay = db.toString();
              log.append(yay);
                                    catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
                                    catch (IOException e)
              // TODO Auto-generated catch block
              e.printStackTrace();
              }I have attempted setting Address back to null after the address was appended but it didn't make any difference.
    Edited by: mudbuggle on Aug 4, 2008 7:19 PM

    I made the adjustments however I am still experiencing the same problem.
    www.yahoo.com returns an ip address but the rest return Unknown Host Exceptions.
    www.yahoo.comjava.net.UnknownHostException:
    forums.sun.com
         at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
         at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
         at java.net.InetAddress.getAddressFromNameService(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
    forums.sun.com     at java.net.InetAddress.getAllByName(Unknown Source)
         at java.net.InetAddress.getByName(Unknown Source)
         at IP$1.actionPerformed(IP.java:83)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    java.net.UnknownHostException:
    www.google.com
         at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
         at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
         at java.net.InetAddress.getAddressFromNameService(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
         at java.net.InetAddress.getByName(Unknown Source)
         at IP$1.actionPerformed(IP.java:83)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • Unknown host exception when weblogic is a https client to another server

    Hi,
    I have weblogic 6.1 sp2. My program connects as a client using https protocol.
    For this the classes provided by wls are used .
    The key , cert and ca files are of weblogic available in wlserver6.1\config\mydomain
    demokey.pem, democert.pem and ca.pem, installed during weblogic installation
    When this code is exceuted it gives a Unknown host exception at the point when
    trying to connect to the url.
    Are there any settings required in weblogic ?
    Regards
    Lata

    Hi,
    I have weblogic 6.1 sp2. My program connects as a client using https protocol.
    For this the classes provided by wls are used .
    The key , cert and ca files are of weblogic available in wlserver6.1\config\mydomain
    demokey.pem, democert.pem and ca.pem, installed during weblogic installation
    When this code is exceuted it gives a Unknown host exception at the point when
    trying to connect to the url.
    Are there any settings required in weblogic ?
    Regards
    Lata

  • Try/Catch Unknown Host Exception

    I need to validate for an error of Unknown Host Exception, in case someone tries connected to a server that doesn't exist, or types the wrong host name, so i can display a message. how do I do that, with a try catch block.
    I thought i would do:
    try{
          my code here such as...
          DatagramSocket socket = new DatagramSocket();
          // send request
          InetAddress address = InetAddress.getByName(args[0]);
          DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 4445);
          socket.send(packet);
        ...and so on, more code...
           socket.close();
    } catch (IOException e) {
           e.printStackTrace();
           System.out.println("Unknown host " + args[0]);
    }

    thanks, i also had to take out the e.printStackTrace(); and replace that with
    my error message and System.exit(0); and I got what i needed!

  • Unknown Host Exception

    Hi,
    I keep getting an UnknownHostException with my JavaMail code. I think the trouble is that my SMTP host is a computer name. Does anyone have any idea is JavaMail doesn't allow computer names as SMTP hosts. I know the host is there, as I have sent email through it using ASP pages before.
    Here's the code just incase it helps. But I know it's correct as I got it off the internet.
    package Gomez;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public final class MailerBean extends Object implements Serializable {
         /* Bean Properties */
         private String to = null;
         private String from = null;
         private String subject = null;
         private String message = null;
         public static Properties props = null;
         public static Session session = null;
         static {
              /*     Setting Properties for STMP host */
              props = System.getProperties();
              props.put("mail.smtp.host", "\\\\svaaoffnot17\\");
              session = Session.getDefaultInstance(props, null);
         /* Setter Methods */
         public void setTo(String to) {
              this.to = to;
         public void setFrom(String from) {
              this.from = from;
         public void setSubject(String subject) {
              this.subject = subject;
         public void setMessage(String message) {
              this.message = message;
         /* Sends Email */
         public void sendMail() throws Exception {
              if(!this.everythingIsSet())
                   throw new Exception("Could not send email.");
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setRecipient(Message.RecipientType.TO,
                        new InternetAddress(this.to));
                   message.setFrom(new InternetAddress(this.from));
                   message.setSubject(this.subject);
                   message.setText(this.message);
                   Transport.send(message);
              } catch (MessagingException e) {
                   throw new Exception(e.getMessage());
         /* Checks whether all properties have been set or not */
         private boolean everythingIsSet() {
              if((this.to == null) || (this.from == null) ||
                 (this.subject == null) || (this.message == null))
                   return false;
              if((this.to.indexOf("@") == -1) ||
                   (this.to.indexOf(".") == -1))
                   return false;
              if((this.from.indexOf("@") == -1) ||
                   (this.from.indexOf(".") == -1))
                   return false;
              return true;
    }

    You need to find the name of the server, and that isn't it. So use ASP to send an e-mail to some address where you can look at the headers. One of these headers will say something like "sent from mail.svaaoffnot17", and that's the name you want to use. Or you could ask the server's administrator...

  • Can't send command to SMTP host

    Hi,
    I am using Jdev11.1.1.2.0 and web logic servere10.3.I am using mail scheduling in weblogic.Actually in window server 2003 I am getting exception is
    get message method--->Can't send command to SMTP host
    javax.mail.MessagingException: Can't send command to SMTP host;
    nested exception is:
    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
    But same application windows7 Its working.
    So can u give me the idea ? or any configuration webloigc in windows server 2003 ?
    Plz help me.
    Thanks
    Anup

    I put environment variable (path) weblogic.jar but still same issue
    get message method--->Can't send command to SMTP host
    javax.mail.MessagingException: Can't send command to SMTP host;
    nested exception is:
         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
         at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:1564)
    Plz give me the solution..
    Thanks
    Anup

Maybe you are looking for

  • Error Downloading KickStart File

    Folks, I am trying to install OEL5 using KickStart. 1. I have kickstart file on my USB 2. I boot HP 580 system from CD Room 3. On booted first screen I have typed following commands, a. linux ks=hd:/dev/sda1:/ks.cfg b. linux ks =hd:sda1/ks.cfg c. lin

  • Hyper-V Core HA Cluster

    Hi,  I am bulding a Highly available cluster from two Hyper-V 2012R2 core nodes and need to clear some things. I would like to know, how to solve AD, when I need the domain controller Highly available. I thought I would have one domain running on a s

  • EJB or PHP

    Hi all I am helping to implement and build a student managment system for the education institution I work for which must be accessibel over the net .And I am having a hard time trying to convince senior mangement to switch from PHP to using the JAVA

  • I drop my ipad 3 64GB and the screen cracked. It is still under warranty period. Will they replace it without cost?

    drop my ipad 3 64GB and the screen cracked. It is still under warranty period. Will they replace it without cost?

  • How to trigger 'save' event without pressing SAVE button

    Hi, i want to execute my 'save' event without press the SAVE button. I want to simulate press the button with abap code and sy-ucomm = 'SAVE'. Is there a function module for this functionality Thanks Reward Points