Announcement Announcement Module
Collapse
No announcement yet.
Connection Timeout! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Connection Timeout!

    Hi Im having problems with sending out emails. Would appreciate help

    GidWS.java
    Code:
    public class GidWS {
    
    	private MailSender mailSender;
        private SimpleMailMessage templateMessage;
    
        public void setMailSender(MailSender mailSender) {
            this.mailSender = mailSender;
        }
    
        public void setTemplateMessage(SimpleMailMessage templateMessage) {
            this.templateMessage = templateMessage;
        }
    	
        public void sendMeMail() {
        	
        	SimpleMailMessage msg = new SimpleMailMessage(this.templateMessage);
            msg.setTo("somemail@gmail[email protected]");
    		msg.setText("Testing Mail.....");
    		 try{
    			 
    	            this.mailSender.send(msg);
    	        }
    	        catch(MailException ex) {
    	           
    	            System.err.println(ex.getMessage()); 
    	            ex.printStackTrace();
    	        }
            }
    
    	public static void main(String[] args) {
    		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("gid.xml", GidWS.class);
    		String requestXml =
    				"<hr:CompanyRequest xmlns:hr=\"http://mycompany.com/hr/schemas\">" +
    				"<hr:Company>"+
    		        "<hr:CompanyName>GetAllCompanies</hr:CompanyName>"+
    	            "</hr:Company>"+
                    "</hr:CompanyRequest>";
    
    		Message<String> message = MessageBuilder.fromPayload(requestXml)
    				.setHeader(AbstractWebServiceHandler.SOAP_ACTION_PROPERTY_KEY, "http://mycompany.com/hr/schemas")
    				.build();
    
    		((MessageChannel)context.getBean("sendChannel")).send(message);
    		
    		GidWS mailtester=(GidWS)context.getBean("msgManager");
    		mailtester.sendMeMail();
    		
    }
    SmtpAuthenticator.java
    Code:
    public class SmtpAuthenticator extends Authenticator {
    	
    	private String username;
    	private String password;
    	
    	public SmtpAuthenticator(String username, String password) {
    		super();
    		this.username = username;
    		this.password = password;
    	}
    
    	public PasswordAuthentication getPasswordAuthentication() {
                    return new PasswordAuthentication(username, password);
    	}
    	
    }
    gid.xml
    Code:
    <message-bus/>
    	<publish-subscribe-channel id="sendChannel"/>
    	<!-- The service activator receives from the 'sendChannel',
    	     invokes the handler, and sends the reply Message to the 'replyChannel'. -->
    	<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="replyChannel1"/>
    	<!-- The handler invokes the WebService for the given URI and returns a reply Message. -->
    	<ws-handler id="msgConverter1" uri="http://localhost:8080/Trial1/companyservice"/>
    	<!-- The response from the service is logged to the console. -->
    	<channel-adapter id="replyChannel1" target="console"/>
    	<console-target id="console"/>
    	<beans:bean id="msgManager" class="org.springframework.integration.gidb.ws.GidWS">
    		<beans:property name="mailSender" ref="mailSender"/>
    		<beans:property name="templateMessage" ref="templateMessage"/>
    	</beans:bean>
    	<beans:bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    		<beans:property name="host" value="66.249.93.109"/>
    		<beans:property name="session" ref="mailSession" />
    	</beans:bean>
    	
    <beans:bean id="mailSession" class="javax.mail.Session"
    		factory-method="getInstance">
    		<beans:constructor-arg>
    			<beans:props>
    				<beans:prop key="mail.smtp.auth">true</beans:prop>
    				<beans:prop key="mail.smtp.starttls.enable">true</beans:prop>
    				<beans:prop key="mail.smtp.debug">true</beans:prop>
    				<beans:prop key="mail.smtp.socketFactory.port">465</beans:prop>
    				<beans:prop key="mail.smtp.socketFactory.class">
    					javax.net.ssl.SSLSocketFactory
    				</beans:prop>
    				<beans:prop key="mail.smtp.socketFactory.fallback">
    					false
    				</beans:prop>
    			</beans:props>
    		</beans:constructor-arg>
    		<beans:constructor-arg ref="smtpAuthenticator" />
    	</beans:bean>
    	
    <!-- our Authenticator implementation -->
    	<beans:bean id="smtpAuthenticator"
    		class="org.springframework.integration.gidb.ws.SmtpAuthenticator">
    		<beans:constructor-arg value="[email protected]" />
    		<beans:constructor-arg value="mypassword" />
    	</beans:bean>
    	<!-- this is a template message that we can pre-load with default state -->
    <beans:bean id="templateMessage" class="org.springframework.mail.SimpleMailMessage">
    		<beans:property name="from" value="[email protected]"/>
    		<beans:property name="subject" value="Email Test"/>
    	</beans:bean>
    </beans:beans>
    Error Message:
    Code:
    nested exception is:
    	java.net.ConnectException: Connection timed out: connect
    org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: 66.249.93.109, port: 25;
      nested exception is:
    	java.net.ConnectException: Connection timed out: connect
    	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)
    	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:308)
    	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:297)
    	at org.springframework.integration.gidb.ws.GidWS.sendMeMail(GidWS.java:36)
    	at org.springframework.integration.gidb.ws.GidWS.main(GidWS.java:81)
    Caused by: javax.mail.MessagingException: Could not connect to SMTP host: 66.249.93.109, port: 25;
      nested exception is:
    	java.net.ConnectException: Connection timed out: connect
    	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1391)
    	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
    	at javax.mail.Service.connect(Service.java:310)
    	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
    	... 4 more
    Caused by: java.net.ConnectException: Connection timed out: connect
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    	at java.net.Socket.connect(Socket.java:520)
    	at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:545)
    	at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
    	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
    	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:163)
    	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
    	... 7 more
    Last edited by ashleyvijay; Oct 27th, 2008, 08:27 AM.

  • #2
    Make sure you can connect using telnet from the machine you are using to send email.

    telnet hostname 25

    Comment


    • #3
      I know Im asking such a dumm question but Im learning it now. I have tried the following in command line : C:\telnet 66.249.93.109 25 and it says telnet is not recogonised as an internal or external command. Im working in a corporate environment. Does the smtp connection problem has something to do with tht?? Please help

      Comment


      • #4
        Ok so on Windows you need a telnet client such as Putty.
        You should see something like below when you connect. If you don't then you have network/mail server issues.

        Connected to localhost.
        Escape character is '^]'.
        220 jpartner-desktop ESMTP Exim 4.69 Mon, 27 Oct 2008 14:58:46 +0000

        Comment


        • #5
          Apache James - Mail Target

          Thanks alot for the response. I want to use Apache James as the mail server to send emails and I dont know how to configure <mail-target> when using Apache James specially the <mail-sender>. Below is my .xml and an Test client (MailClient.java )which was used to test James Server.Basically I want to configure this test Client in .xml. Would apprecaite help

          xml config

          Code:
          <message-bus/>
          	<publish-subscribe-channel id="sendChannel"/>
          	<!-- The service activator receives from the 'sendChannel',
          	     invokes the handler, and sends the reply Message to the 'replyChannel'. -->
          	<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="replyChannel1"/>
          	
          	<!-- The handler invokes the WebService for the given URI and returns a reply Message. -->
          	<ws-handler id="msgConverter1" uri="http://localhost:8080/Trial1/companyservice"/>
          	<!-- The response from the service is sent to email target. -->
          	<channel-adapter id="replyChannel1" target="mailTarget"/>
          	
          <mail-target id="mailTarget" host="localhost"  username="root" password="root"  />
          	
          </beans:beans>
          MailClient.java
          Code:
          package org.springframework.integration.gidb.JamesTest;
          import java.io.*;
          import java.util.*;
          import javax.mail.*;
          import javax.mail.internet.*;
          
          public class MailClient extends Authenticator
          	{
          	  public static final int SHOW_MESSAGES = 1;
          	  public static final int CLEAR_MESSAGES = 2;
          	  public static final int SHOW_AND_CLEAR =
          	    SHOW_MESSAGES + CLEAR_MESSAGES;
          	  
          	  protected String from;
          	  protected Session session;
          	  protected PasswordAuthentication authentication;
          	  
          	  public MailClient(String user, String host)
          	  {
          	    this(user, host, false);
          	  }
          	  
          	  public MailClient(String user, String host, boolean debug)
          	  {
          	    from = user + '@' + host;
          	    authentication = new PasswordAuthentication(user, user);
          	    Properties props = new Properties();
          	    props.put("mail.user", user);
          	    props.put("mail.host", host);
          	    props.put("mail.debug", debug ? "true" : "false");
          	    props.put("mail.store.protocol", "pop3");
          	    props.put("mail.transport.protocol", "smtp");
          	    session = Session.getInstance(props, this);
          	  }
          	  
          	  public PasswordAuthentication getPasswordAuthentication()
          	  {
          	    return authentication;
          	  }
          	  public void sendMessage(
          			    String to, String subject, String content)
          			      throws MessagingException
          			  {
          			    System.out.println("SENDING message from " + from + " to " + to);
          			    System.out.println();
          			    MimeMessage msg = new MimeMessage(session);
          			    msg.addRecipients(Message.RecipientType.TO, to);
          			    msg.setSubject(subject);
          			    msg.setText(content);
          			    Transport.send(msg);
          			  }
          			  
          			  public void checkInbox(int mode)
          			    throws MessagingException, IOException
          			  {
          			    if (mode == 0) return;
          			    boolean show = (mode & SHOW_MESSAGES) > 0;
          			    boolean clear = (mode & CLEAR_MESSAGES) > 0;
          			    String action =
          			      (show ? "Show" : "") +
          			      (show && clear ? " and " : "") +
          			      (clear ? "Clear" : "");
          			    System.out.println(action + " INBOX for " + from);
          			    Store store = session.getStore();
          			    store.connect();
          			    Folder root = store.getDefaultFolder();
          			    Folder inbox = root.getFolder("inbox");
          			    inbox.open(Folder.READ_WRITE);
          			    Message[] msgs = inbox.getMessages();
          			    if (msgs.length == 0 && show)
          			    {
          			      System.out.println("No messages in inbox");
          			    }
          			    for (int i = 0; i < msgs.length; i++)
          			    {
          			      MimeMessage msg = (MimeMessage)msgs[i];
          			      if (show)
          			      {
          			        System.out.println("    From: " + msg.getFrom()[0]);
          			        System.out.println(" Subject: " + msg.getSubject());
          			        System.out.println(" Content: " + msg.getContent());
          			      }
          			      if (clear)
          			      {
          			        msg.setFlag(Flags.Flag.DELETED, true);
          			      }
          			    }
          			    inbox.close(true);
          			    store.close();
          			    System.out.println();
          			  }
          			 public static void main(String[] args)throws Exception {
          					// TODO Auto-generated method stub
          
          					 // CREATE CLIENT INSTANCES
          				    MailClient redClient = new MailClient("red", "localhost");
          				    MailClient greenClient = new MailClient("green", "localhost");
          				    MailClient blueClient = new MailClient("blue", "localhost");
          				    
          				    // CLEAR EVERYBODY'S INBOX
          				    redClient.checkInbox(MailClient.CLEAR_MESSAGES);
          				    greenClient.checkInbox(MailClient.CLEAR_MESSAGES);
          				    blueClient.checkInbox(MailClient.CLEAR_MESSAGES);
          				    Thread.sleep(500); // Let the server catch up
          				    
          				    // SEND A COUPLE OF MESSAGES TO BLUE (FROM RED AND GREEN)
          				    redClient.sendMessage(
          				      "blue@localhost",
          				      "Testing blue from red",
          				      "This is a test message");
          				    greenClient.sendMessage(
          				      "blue@localhost",
          				      "Testing blue from green",
          				      "This is a test message");
          				    Thread.sleep(500); // Let the server catch up
          				    
          				    // LIST MESSAGES FOR BLUE (EXPECT MESSAGES FROM RED AND GREEN)
          				    blueClient.checkInbox(MailClient.SHOW_AND_CLEAR);
          				
          				
          				
          				}
          
          }
          Last edited by ashleyvijay; Oct 28th, 2008, 09:46 AM.

          Comment


          • #6
            Nobody has a solution???

            Can somebody help me with my problem..Please....

            Comment


            • #7
              What exactly is your problem? What have you tried and what problems have you encountered? What version of Spring Integration are you using? You need to give more detail to allow people to offer assistance. The xml configuration looks sane assuming you are running a local smtp server and those are the correct credentials for connecting to it.

              Comment


              • #8
                Thanks for ur concern and sorry abt the confusion. Basically I want to use MailClient.java to send emails using Apache James as the mail server but how can I configure in xml. Could it be something like this
                Code:
                <message-bus/>
                	<publish-subscribe-channel id="sendChannel"/>
                	<!-- The service activator receives from the 'sendChannel',
                	     invokes the handler, and sends the reply Message to the 'replyChannel'. -->
                	<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="replyChannel1"/>
                	<ws-handler id="msgConverter1" uri="http://localhost:8080/Trial1/companyservice"/>
                	<!-- The response from the service is sent as email. -->
                	<channel-adapter id="replyChannel1" target="mailTarget"/>
                	
                	<beans:bean id="mailTarget" class="org.springframework.integration.adapter.mail.MailTarget"> 
                	<property name="mailSender" ref="javaMailSender"/> 
                    <property name="headerGenerator" ref="dynamicMailMessageHeaderGenerator"/>
                	</beans:bean>
                	Dont know how to proceed after this to use MailClient.java
                
                </beans:beans>
                Last edited by ashleyvijay; Oct 29th, 2008, 06:33 AM.

                Comment


                • #9
                  The point of mail target is that you don't need to write the MailClient type code to send an email over SMTP. So you put an instance of Spring Integration Message on a channel and that is translated into an email and sent by the mail-target that is the common idea behind all of the adapters.

                  So for example the following example using Spring Integration M6 sends a message to my local smtp server.

                  Code:
                  <si:message-bus />
                  <si:channel  id="requests" />
                  
                  <si:channel-adapter channel="requests" target="mailTarget"/>
                  <si:mail-target id="mailTarget" host="localhost"/>
                  Code:
                  	
                  MessageBuilder<String> builder = MessageBuilder.fromPayload("bob");
                  builder.setHeader(MailHeaders.TO, "jpartner@localhost");
                  requests.send(builder.build());
                  Here I am specifying in code the to address when I create the message. This will automatically be picked up by the DefaultMailHeaderGenerator which is used if you don't specify a header-generator.

                  You can also specify this in xml
                  Code:
                  <si:message-bus />
                  <si:channel  id="requests" />
                  
                  <si:channel-adapter channel="requests" target="mailTarget"/>
                  <si:mail-target id="mailTarget" host="localhost" header-generator="mailHeader" />
                  
                  <bean id="mailHeader" class="org.springframework.integration.adapter.mail.StaticMailHeaderGenerator">
                  	<property name="to" value="jpartner@localhost" />
                  	<property name="subject" value="Something or other" />
                  </bean>
                  using the header-generator attribute you can reference any bean that implements MailHeaderGenerator

                  Comment


                  • #10
                    Ah this is exactly wht I wanted. I probably confused myself b4. Thank u so much.

                    Comment


                    • #11
                      If I understood right its either u specify the header generator in bean or u code them right?? which means then I wouldnt need the MailClient.java instead I would have to use just the mail target adapter to send emails right?? And I What abt the mail sender? how would u configure tht?? Thanks for ur help in advance

                      Comment


                      • #12
                        Please refer to the Spring Reference Documentation: http://static.springframework.org/sp...nce/index.html

                        There is an "Email" chapter with a full explanation and examples.

                        Comment


                        • #13
                          Hi Mark Thanks for the response. I have configured the mail target like this now and Im using Apache James as mail server.What could be the problem??
                          Code:
                          	
                          <message-bus/>
                          	<publish-subscribe-channel id="sendChannel"/>
                          	<service-activator input-channel="sendChannel" ref="msgConverter1" output-channel="replyChannel1"/>
                          	<ws-handler id="msgConverter1" uri="http://localhost:8080/Trial1/companyservice"/>
                          	<channel-adapter id="replyChannel1" target="mailTarget"/>
                          	<mail-target id="mailTarget" header-generator="mailHeader" mail-sender="mailSender"/>
                          	<beans:bean id="mailHeader" class="org.springframework.integration.adapter.mail.StaticMailHeaderGenerator">
                          	<beans:property name="to" value="receiver@localhost" />
                          	<beans:property name="subject" value="Test Mail" />
                          	<beans:property name="from" value="sender@localhost"/>
                          </beans:bean>
                          <beans:bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
                           <beans:property name="host" value="localhost"/>
                           <beans:property name="port" value="4555"/>
                          </beans:bean>
                          </beans:beans>
                          Error Message:
                          Code:
                           INFO: message bus started
                          Oct 29, 2008 3:57:16 PM org.springframework.integration.endpoint.AbstractEndpoint handleException
                          WARNING: exception occurred in endpoint 'replyChannel1.adapter'
                          org.springframework.integration.message.MessageHandlingException: failure occurred in endpoint 'replyChannel1.adapter'
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:119)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:75)
                          	at org.springframework.integration.dispatcher.SimpleDispatcher.send(SimpleDispatcher.java:48)
                          	at org.springframework.integration.channel.DirectChannel.doSend(DirectChannel.java:46)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.endpoint.DefaultEndpoint.sendReplyMessage(DefaultEndpoint.java:157)
                          	at org.springframework.integration.endpoint.AbstractRequestReplyEndpoint.sendInternal(AbstractRequestReplyEndpoint.java:77)
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:111)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:75)
                          	at org.springframework.integration.dispatcher.BroadcastingDispatcher.send(BroadcastingDispatcher.java:64)
                          	at org.springframework.integration.channel.PublishSubscribeChannel.doSend(PublishSubscribeChannel.java:61)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
                          	at org.springframework.integration.gidb.ws.GidWS.main(GidWS.java:44)
                          Caused by: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 4555, response: -1
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:308)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:297)
                          	at org.springframework.integration.adapter.mail.MailTarget.sendMailMessage(MailTarget.java:106)
                          	at org.springframework.integration.adapter.mail.MailTarget.send(MailTarget.java:89)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.endpoint.OutboundChannelAdapter.sendInternal(OutboundChannelAdapter.java:32)
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:111)
                          	... 20 more
                          Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 4555, response: -1
                          	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1379)
                          	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
                          	at javax.mail.Service.connect(Service.java:288)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
                          	... 28 more
                          Oct 29, 2008 3:57:16 PM org.springframework.integration.endpoint.AbstractEndpoint handleException
                          WARNING: exception occurred in endpoint 'org.springframework.integration.endpoint.DefaultEndpoint#0'
                          org.springframework.integration.message.MessageHandlingException: failure occurred in endpoint 'replyChannel1.adapter'
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:119)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:75)
                          	at org.springframework.integration.dispatcher.SimpleDispatcher.send(SimpleDispatcher.java:48)
                          	at org.springframework.integration.channel.DirectChannel.doSend(DirectChannel.java:46)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.endpoint.DefaultEndpoint.sendReplyMessage(DefaultEndpoint.java:157)
                          	at org.springframework.integration.endpoint.AbstractRequestReplyEndpoint.sendInternal(AbstractRequestReplyEndpoint.java:77)
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:111)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToTarget(AbstractDispatcher.java:75)
                          	at org.springframework.integration.dispatcher.BroadcastingDispatcher.send(BroadcastingDispatcher.java:64)
                          	at org.springframework.integration.channel.PublishSubscribeChannel.doSend(PublishSubscribeChannel.java:61)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
                          	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
                          	at org.springframework.integration.gidb.ws.GidWS.main(GidWS.java:44)
                          Caused by: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 4555, response: -1
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:308)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:297)
                          	at org.springframework.integration.adapter.mail.MailTarget.sendMailMessage(MailTarget.java:106)
                          	at org.springframework.integration.adapter.mail.MailTarget.send(MailTarget.java:89)
                          	at org.springframework.integration.message.MessageExchangeTemplate.doSend(MessageExchangeTemplate.java:200)
                          	at org.springframework.integration.message.MessageExchangeTemplate.send(MessageExchangeTemplate.java:155)
                          	at org.springframework.integration.endpoint.OutboundChannelAdapter.sendInternal(OutboundChannelAdapter.java:32)
                          	at org.springframework.integration.endpoint.AbstractEndpoint.send(AbstractEndpoint.java:111)
                          	... 20 more
                          Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 4555, response: -1
                          	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1379)
                          	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:412)
                          	at javax.mail.Service.connect(Service.java:288)
                          	at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
                          	... 28 more
                          Last edited by ashleyvijay; Oct 29th, 2008, 10:19 AM.

                          Comment


                          • #14
                            Ok I got the stuff fixed and it works perfectly now!! Thanks alot Mark and Jonas for all ur responses.
                            Last edited by ashleyvijay; Oct 30th, 2008, 10:20 AM.

                            Comment

                            Working...
                            X