Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 50119 invoked from network); 16 Dec 2005 18:15:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Dec 2005 18:15:47 -0000 Received: (qmail 83795 invoked by uid 500); 16 Dec 2005 18:15:44 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 83772 invoked by uid 500); 16 Dec 2005 18:15: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 83761 invoked by uid 99); 16 Dec 2005 18:15:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 10:15: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 (asf.osuosl.org: domain of ammulder@gmail.com designates 64.233.162.196 as permitted sender) Received: from [64.233.162.196] (HELO zproxy.gmail.com) (64.233.162.196) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2005 10:15:41 -0800 Received: by zproxy.gmail.com with SMTP id z6so741320nzd for ; Fri, 16 Dec 2005 10:15:20 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T30/CIyiLPXjfnNdhv5rH2w1BhZcK1ahYDYSBP8b6cB4S7yEdMG25+mSAtKpwTAoYx0gvdzvTf4ADCJmgkx+pECWRCg5l82xMkjnHUY5L+8+vem6xloVdGk/4iXNEKJz4ytVKsLrn9BqMqfnzyZGJeJma8+wOlOM77YorQe/m9g= Received: by 10.36.121.2 with SMTP id t2mr3343415nzc; Fri, 16 Dec 2005 10:15:20 -0800 (PST) Received: by 10.37.13.69 with HTTP; Fri, 16 Dec 2005 10:15:20 -0800 (PST) Message-ID: <74e15baa0512161015j4828ed08l9b0902829c6449b1@mail.gmail.com> Date: Fri, 16 Dec 2005 13:15:20 -0500 From: Aaron Mulder Sender: ammulder@gmail.com To: user@geronimo.apache.org Subject: Re: javamail issue In-Reply-To: <1134712012.3457.2.camel@ent05f03> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1134384411.32661.29.camel@localhost.localdomain> <439E75DA.3040500@hogstrom.org> <1134559910.25995.23.camel@ent05f03> <74e15baa0512141127g6fd0a35lfc3a114b80383cd2@mail.gmail.com> <1134634319.30344.3.camel@ent05f03> <1134712012.3457.2.camel@ent05f03> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 12/16/05, Arun Venugopal wrote: > Hi, > > I am sorry if i have made my question more complicated that it really is= . My question was simply that why that piece of code (that i had given in m= y original mail) does not seem to work when used with geronimo although it = works fine as a standalone java class. The answer to that is that Geronimo does not include our JavaMail transports on the class path for your application unless the application depends on the JavaMail configuration I declared above.=20 It's possible we don't even include the interfaces unless you depend on the JavaMail configuration, I'm not sure about that. In any case, bottom line, you won't have the classes you need on your application's class path without the line I gave you above. I assume that in your standalone application you added JavaMail to the class path for the application when you ran it. Aaron > On Thu, 2005-12-15 at 10:44 -0800, Dain Sundstrom wrote: > I'm not sure what you are asking. JavaMail is a specification > published by the Java Community Process. We provide a clean room > implementation of this specification with the Geronimo server > starting with version 1.0. If you would like to use the > implementation published by Sun Microsystems, that is also possible, > but you will have to acquire that implementation from Sun (it is > free) since licensing restrictions prevent us from shipping it with > our server. > > -dain > > On Dec 15, 2005, at 12:11 AM, Arun Venugopal wrote: > > > Hi Aaaron, > > > > Does that mean that I cannot use the plain javamail implementation > > in Geronimo and that I have to use the APIs provided by Geronimo > > > > Thanks and regards > > Arun > > > > On Wed, 2005-12-14 at 14:27 -0500, Aaron Mulder wrote: > >> If you're planning to use Geronimo's JavaMail features, you should > >> be on a very current version (built from source or the 1.0 release > >> candidate). Then you want to add a line like this to your Geronimo > >> deployment plan: geronimo/javamail/1.0/car That > >> way, you should be sure to get our JavaMail code on the classpath > >> of your application. The JavaMail configuration is not started by > >> default, though it should be started when you deploy an > >> application that depends on it. If you want to start it by hand, > >> you can always use java -jar bin/deployer.jar start geronimo/ > >> javamail/1.0/car Thanks, Aaron On 12/14/05, Arun Venugopal > >> wrote: > Hi, > > I have this piece > >> of code that uses javamail . This code works fine when i try it as > >> a standalone java application (ie when i put it in java file, > >> compile it and run it). But when i put this code in an war (and > >> call it from a servlet) and then deploy the war in geronimo, it > >> does not work. I am pretty sure that this code is being called as > >> any System.out.println that i give in between the code gets > >> displayed in the console. Also i tried out the same code in JBoss > >> and it seems to work there also. > > I have seen many discussions > >> in the dev list regarding the JavaMail implementation. But i think > >> all that is with regards to creating a new API for geronimo in the > >> lines of the mail API's present in JBoss. And that since i am > >> using plain java mail it should work irrespective of the > >> application server. > > Can any one give me any pointers on why i > >> am having this issue in geronimo and if i can solve it ... > > > > >> --------------------------------------------------------------------- > >> -------------------------------------------------- > > // > >> substitute your mail address here > String from =3D "a@b.c"; > > >> String to =3D "a@b.c"; > //substitute the host name or ip of your > >> smtp server here > String host =3D "1.2.3.4"; > Properties props =3D > >> new Properties(); > props.put("mail.smtp.host", host); > props.put > >> ("mail.debug", "true"); > Session session =3D Session.getInstance > >> (props); > try { > > Message msg =3D new MimeMessage(session); > > >> msg.setFrom(new InternetAddress(from)); > InternetAddress[] > >> address =3D {new InternetAddress(to)}; > msg.setRecipients > >> (Message.RecipientType.TO, address); > msg.setSubject("Test E-Mail > >> through Java"); > msg.setContent(msg, "text/plain"); > > >> msg.setSentDate(new Date()); > msg.setText("Test Message"); > > >> Transport.send(msg); > > > >> --------------------------------------------------------------------- > >> ---------------------------------------------------- > > > > > >> Thanks in advance > > Regards > Arun > > > This e-mail and any > >> files transmitted with it are for the sole use of the intended > >> recipient(s) and may contain confidential and privileged > >> information. > If you are not the intended recipient, please > >> contact the sender by reply e-mail and destroy all copies of the > >> original message. > Any unauthorized review, use, disclosure, > >> dissemination, forwarding, printing or copying of this email or > >> any action taken in reliance on this e-mail is strictly > > >> prohibited and may be unlawful. > > Visit us at http:// > >> www.cognizant.com > > > This e-mail and any files transmitted with it are for the sole use > > of the intended recipient(s) and may contain confidential and > > privileged information. > > If you are not the intended recipient, please contact the sender by > > reply e-mail and destroy all copies of the original message. > > Any unauthorized review, use, disclosure, dissemination, > > forwarding, printing or copying of this email or any action taken > > in reliance on this e-mail is strictly > > prohibited and may be unlawful. > > > > Visit us at http://www.cognizant.com > > > > This e-mail and any files transmitted with it are for the sole use of the= intended recipient(s) and may contain confidential and privileged informat= ion. > If you are not the intended recipient, please contact the sender by repl= y e-mail and destroy all copies of the original message. > Any unauthorized review, use, disclosure, dissemination, forwarding, pri= nting or copying of this email or any action taken in reliance on this e-ma= il is strictly > prohibited and may be unlawful. > > Visit us at http://www.cognizant.com >