Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 74474 invoked from network); 22 Feb 2007 12:30:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2007 12:30:41 -0000 Received: (qmail 28958 invoked by uid 500); 22 Feb 2007 12:30:44 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 28938 invoked by uid 500); 22 Feb 2007 12:30:44 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 28912 invoked by uid 99); 22 Feb 2007 12:30:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2007 04:30:44 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rickmcg@gmail.com designates 66.249.82.232 as permitted sender) Received: from [66.249.82.232] (HELO wx-out-0506.google.com) (66.249.82.232) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2007 04:30:32 -0800 Received: by wx-out-0506.google.com with SMTP id s18so138246wxc for ; Thu, 22 Feb 2007 04:30:11 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=XtkiFay35qpzcTV5eHW6eRV035kWcErvifb4c5dNakr/o4hXuq894hQ1xBXGU9X65Byfeqebr7LJgTjqoQNqiXGZlCmbH9P59tbaFO5jRzCETrseYixyBt2oGd2E1blIwYT2Xa3rzSpSE3jnN4PpuTjCnT82PENMks7chFROhTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Ckf5KaN6pemh2XbOXb+TY83maFy44vmi44cEQsgd5N3o41/1ZOoHFJOPoBrO8wT8+Ar+loX8Im9LKnXx30XTI4mXUb4hGYrI17JHB/yHgBfZ3uCwKs4PTdme/kn25vhFoYdFWM5Xv/J0ORpxjC0AAbVa2zfIQ5XmwiIJLF2dO/A= Received: by 10.70.38.12 with SMTP id l12mr1073576wxl.1172147411433; Thu, 22 Feb 2007 04:30:11 -0800 (PST) Received: from ?192.168.1.101? ( [68.191.49.248]) by mx.google.com with ESMTP id h34sm877820wxd.2007.02.22.04.30.10; Thu, 22 Feb 2007 04:30:10 -0800 (PST) Message-ID: <45DD8CD3.1080400@gmail.com> Date: Thu, 22 Feb 2007 07:30:11 -0500 From: Rick McGuire Reply-To: rickmcg@gmail.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: user@geronimo.apache.org Subject: Re: javax.mail.MessagingException: .. could not connect to SMTPhost-Reg References: <45DD6E58.4060302@gmail.com> <45DD826E.2010003@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Kamalanathan Raman wrote: > Hi Rick, > > I forgot to mention one point in my previous mail , iam using the mail > resource that is available in the Geronimo and see my > geronimo-application.xml > > class="org.apache.geronimo.mail.MailGBean"> > smtp > false > name="host">BLRKECMSG13.ad.infosys.com > > mail.debug=true > mail.smtp.port=25 > mail.from=kamalanathan_raman@infosys.com > > > If you are creating a Session using Sessiont.getInstance(), then you are NOT using the mail resource. If you're using javamail in that mode, than this configuration information has no effect on what happens. Rick > > Kindly let me know whether this is correct or do I need to change > anything. > > > Thanks and Regards, > Kamal > > -----Original Message----- > From: Rick McGuire [mailto:rickmcg@gmail.com] > Sent: Thursday, February 22, 2007 5:16 PM > To: user@geronimo.apache.org > Subject: Re: javax.mail.MessagingException: .. could not connect to > SMTPhost-Reg > > I already did. It is picking up the "localhost" attribute because it's > not properly using the "mail.smtp.host" property to configure the target > > SMTP host. Either of the two solutions I gave you below will fix the > problem. > > How are you creating the mail Session in your application? Are you > picking up the Geronimo mail resource, or are you configuring one > yourself by calling Session.getInstance() or > Session.getDefaultInstance()? If you are using the Geronimo resource, > then you need to specify a hostname on the MailGBean in your > config.xml. The following added in the same section as the > SMTPTransport should do it: > > > myhost > > > If you're not using the mail/MailResource provided by the server, then > you need to make sure you set the property "mail.host" to your host in > the property bundle you use when you call Session.getInstance(). > > Rick > > > Kamalanathan Raman wrote: > >> Hi Rick, >> >> Thanks for replying, iam not sure from where it is picking the >> "localhost" attribute . I have mentioned my mail server host which is >> different everywhere in my application and also i have changed in the >> "config.xml" file inside Geronimo/var folder also to reflect to my >> > host > >> , but iam not sure from where it is picking up this attribute. Kindly >> help me resolve this issue. >> >> Thanks and Regards, >> Kamal >> >> -----Original Message----- >> From: Rick McGuire [mailto:rickmcg@gmail.com] >> Sent: Thursday, February 22, 2007 3:50 PM >> To: user@geronimo.apache.org >> Subject: Re: javax.mail.MessagingException: .. could not connect to >> SMTPhost -Reg >> >> There's a bug in the code that sorts out the connection host when you >> are using Transport.send(). There are two workarounds I know of for >> > the > >> problem: >> >> 1) set the target SMTP host using the "mail.host" property rather than >> > > >> "mail.smtp.host", or >> 2) Rather than use Transport.send(), explicitly request a transport >> instance from the Session and call connect() yourself, passing in the >> appropriate target and port. >> >> It also appears from the Exception getting thrown and the stack trace, >> > > >> that your application is picking up the Sun mail.jar, resulting in >> mixing of the Geronimo mail api code with the Sun SMTPTransport >> implemenation. This should, in theory, work, but is not a >> > configuration > >> we've doing any testing with at all. You should remove any dependency >> you have on the sun mail.jar and make sure you're picking up the >> geronimo-javamail-transport jar included with 1.1.1. >> >> Rick >> >> Kamalanathan Raman wrote: >> >> >>> Hi , >>> >>> Iam trying to send a notification mail using the java mail in >>> > Geronimo > >>> >>> >> >> >>> 1.1.1 . When I try to send the mail iam getting this following >>> exception , can any one give a pointer regarding where iam going >>> > wrong > >>> >>> >> >> >>> and what to do... >>> >>> _javax.mail.SendFailedException_: Send failure >>> (_javax.mail.MessagingException_: Could not connect to SMTP host: >>> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >>> > > >>> connect)) >>> >>> at javax.mail.Transport.send(_Transport.java:161_) >>> >>> at javax.mail.Transport.send(_Transport.java:46_) >>> >>> at >>> >>> >> com.symcor.common.util.SendMail.sendNotification(_SendMail.java:171_) >> >> >>> at >>> >>> >> com.symcor.common.util.SendMail.sendNotification(_SendMail.java:92_) >> >> >>> at >>> > com.symcor.eds.app.RunEDSService.sendMail(_RunEDSService.java:411_) > >>> at com.symcor.eds.app.RunEDSService.main(_RunEDSService.java:338_) >>> >>> Caused by: _javax.mail.MessagingException_: Could not connect to SMTP >>> > > >>> host: localhost, port: 25 (_java.net.ConnectException_: Connection >>> refused: connect) >>> >>> at >>> >>> >> com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:867_) >> >> >>> at >>> >>> >>> > com.sun.mail.smtp.SMTPTransport.protocolConnect(_SMTPTransport.java:156_ > >> ) >> >> >>> at javax.mail.Service.connect(_Service.java:215_) >>> >>> at javax.mail.Service.connect(_Service.java:83_) >>> >>> at javax.mail.Service.connect(_Service.java:68_) >>> >>> at com.sun.mail.smtp.SMTPTransport.connect(_SMTPTransport.java:93_) >>> >>> at javax.mail.Transport.send(_Transport.java:92_) >>> >>> ... 5 more >>> >>> Caused by: _java.net.ConnectException_: Connection refused: connect >>> >>> at java.net.PlainSocketImpl.socketConnect(_Native Method_) >>> >>> at java.net.PlainSocketImpl.doConnect(Unknown Source) >>> >>> at java.net.PlainSocketImpl.connectToAddress(Unknown Source) >>> >>> 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 java.net.Socket.(Unknown Source) >>> >>> at java.net.Socket.(Unknown Source) >>> >>> at >>> >>> >> com.sun.mail.util.SocketFetcher.getSocket0(_SocketFetcher.java:131_) >> >> >>> at >>> > com.sun.mail.util.SocketFetcher.getSocket(_SocketFetcher.java:113_) > >>> at >>> >>> >> com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:836_) >> >> >>> ... 11 more >>> >>> 2007-02-22 14:50:47,674 INFO com.symcor.common.util.SendMail >>> -sendNotification(...):exit >>> >>> 2007-02-22 14:50:47,674 ERROR root -main[]:Send failure >>> (_javax.mail.MessagingException_: Could not connect to SMTP host: >>> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >>> > > >>> connect)) >>> >>> _javax.mail.SendFailedException_: Send failure >>> (_javax.mail.MessagingException_: Could not connect to SMTP host: >>> localhost, port: 25 (_java.net.ConnectException_: Connection refused: >>> > > >>> connect)) >>> >>> at javax.mail.Transport.send(_Transport.java:161_) >>> >>> at javax.mail.Transport.send(_Transport.java:46_) >>> >>> at >>> >>> >> com.symcor.common.util.SendMail.sendNotification(_SendMail.java:171_) >> >> >>> at >>> >>> >> com.symcor.common.util.SendMail.sendNotification(_SendMail.java:92_) >> >> >>> at >>> > com.symcor.eds.app.RunEDSService.sendMail(_RunEDSService.java:411_) > >>> at com.symcor.eds.app.RunEDSService.main(_RunEDSService.java:338_) >>> >>> Caused by: _javax.mail.MessagingException_: Could not connect to SMTP >>> > > >>> host: localhost, port: 25 (_java.net.ConnectException_: Connection >>> refused: connect) >>> >>> at >>> >>> >> com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:867_) >> >> >>> at >>> >>> >>> > com.sun.mail.smtp.SMTPTransport.protocolConnect(_SMTPTransport.java:156_ > >> ) >> >> >>> at javax.mail.Service.connect(_Service.java:215_) >>> >>> at javax.mail.Service.connect(_Service.java:83_) >>> >>> at javax.mail.Service.connect(_Service.java:68_) >>> >>> at com.sun.mail.smtp.SMTPTransport.connect(_SMTPTransport.java:93_) >>> >>> at javax.mail.Transport.send(_Transport.java:92_) >>> >>> ... 5 more >>> >>> Caused by: _java.net.ConnectException_: Connection refused: connect >>> >>> at java.net.PlainSocketImpl.socketConnect(_Native Method_) >>> >>> at java.net.PlainSocketImpl.doConnect(Unknown Source) >>> >>> at java.net.PlainSocketImpl.connectToAddress(Unknown Source) >>> >>> 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 java.net.Socket.(Unknown Source) >>> >>> at java.net.Socket.(Unknown Source) >>> >>> at >>> >>> >> com.sun.mail.util.SocketFetcher.getSocket0(_SocketFetcher.java:131_) >> >> >>> at >>> > com.sun.mail.util.SocketFetcher.getSocket(_SocketFetcher.java:113_) > >>> at >>> >>> >> com.sun.mail.smtp.SMTPTransport.openServer(_SMTPTransport.java:836_) >> >> >>> ... 11 more >>> >>> Thanks and Regards, >>> >>> Kamal >>> >>> **************** CAUTION - Disclaimer ***************** >>> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended >>> > > >>> solely for the use of the addressee(s). If you are not the intended >>> recipient, please notify the sender by e-mail and delete the original >>> > > >>> message. Further, you are not to copy, disclose, or distribute this >>> e-mail or its contents to any other person and any such actions are >>> unlawful. This e-mail may contain viruses. Infosys has taken every >>> reasonable precaution to minimize this risk, but is not liable for >>> > any > >>> >>> >> >> >>> damage you may sustain as a result of any virus in this e-mail. You >>> should carry out your own virus checks before opening the e-mail or >>> attachment. Infosys reserves the right to monitor and review the >>> content of all messages sent to or from this e-mail address. Messages >>> > > >>> sent to or from this e-mail address may be stored on the Infosys >>> e-mail system. >>> ***INFOSYS******** End of Disclaimer ********INFOSYS*** >>> >>> >>> >> >> > > >