geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajith Attapattu <rajit...@gmail.com>
Subject Re: javamail
Date Wed, 18 Jan 2006 16:53:59 GMT
Alex,

Unfortunately I don't have time right now to try out the mail funtionality
myself. I can try to do that in the evening when I go home.

Meanwhile lets hope that somebody else might be able to come with a better
idea to help u.

Regards,

Rajith.


On 1/18/06, Alex Andrushchak <ustas@dekasoft.com.ua> wrote:
>
> There are my two methods from my MailerBean:
>     public void setMessage(String recipient, String cc, String subject,
> String content)
>         throws Exception, RemoteException
>     {
>         System.out.println("SessionMailerBean.setMessage: checkpoint 1.");
>
>         // Get the initial context
>         InitialContext ictx = null;
>         try {
>             ictx = new InitialContext();
>         } catch (NamingException e) {
>             throw new Exception("Can not get an inital context : " +
> e.getMessage());
>         }
>
>         // get a new Session from our ENC envirnoment java:comp/env
>         Session session = null;
>         try {
>             session = (Session) ictx.lookup(
> "java:comp/env/mail/MailSession");
>         } catch (NamingException e) {
>             throw new Exception("You have not configure the mail factory "
>                     + " ifor java:comp/env/mail/MailSession." +
> e.getMessage());
>         }
>
>         session.setDebug(true);
>
>         try {
>             //Create the message
>             message = new MimeMessage(session);
>             InternetAddress[] toRecipients = new InternetAddress[] {new
> InternetAddress(recipient)};
>             message.setRecipients(Message.RecipientType.TO<http://message.recipienttype.to/>,
> toRecipients);
>             message.setSubject(subject, MAIL_CHARSET);
>             message.setText(content, MAIL_CHARSET);
>
>             if ( null != cc ) {
>                 InternetAddress[] ccs = new InternetAddress[] {new
> InternetAddress(cc)};
>                 message.setRecipients(Message.RecipientType.CC<http://message.recipienttype.cc/>,
> ccs);
>             }
>
>             //message.setContent(content, "text/plain");
>         } catch (MessagingException e) {
>             throw new Exception("A failure occurs when getting a message
> from the session and setting "
>                     + "the different parameters :" + e.getMessage());
>         }
>
>         System.out.println("SessionMailerBean.setMessage: checkpoint 2.");
>     }
>
>     public void send() throws Exception, RemoteException {
>         System.out.println("SessionMailerBean.send: checkpoint 1.");
>         if (message == null) {
>             throw new Exception("The message can not be send because the
> method setMessage() "
>                     + " was not called before the send() method.");
>         }
>
>         try {
>             Transport.send(message);
>         } catch (MessagingException e) {
>             throw new Exception("The message can not be send : " +
> e.getMessage());
>         }
>         System.out.println("SessionMailerBean.send: checkpoint 2.");
>     }
>
> I've add debug to mail session but nothing :-(
> Unfortunatelly i have not configured environment for remote debug.
> Any advice?
>
> Best regards,
> Alex Andrushchak
>
> Rajith Attapattu wrote:
>
> Alex,
>
> Sorry about the mix up, actually Can u set Session.setDebug(true) (
> javax.mail.Session) in your code.
>
> for u to send the mail u must be getting a session and then accesing the
> trasport by using the getTransport(). So when u get an instance of
> Session please set the above value.to true. If you are not sure about it,
> pls email the code segment and I will point it out.
>
> If there is not enough debug info, can u please remote debug with the info
> I provided above.
>
> Regards,
>
> Rajith.
>
> On 1/18/06, Alex Andrushchak <ustas@dekasoft.com.ua> wrote:
> >
> > Hi!
> >
> > I've switched log lovel to debug. But there aren't any debug messaging
> > about mail delivery, only struts debug messages  :-(
> > Are there any other posibility to dig this case?
> >
> > Best regards,
> > Alex Andrushchak
> >
> > Rajith Attapattu wrote:
> >
> >  check the following url
> >
> > http://opensource2.atlassian.com/confluence/oss/display/GERONIMO/Geronimo+Administration+Console
> >
> >
> > Login to the admin console default user/pwd is system/manager
> > go to the section called "Server", under that there is LogManager.
> > Change the log level to debug.
> >
> > btw the http://opensource2.atlassian.com/confluence/oss/pages/viewpage.action?pageId=1692
> >
> > will give u some very good information about Geronimo. It's still work
> > in progress but basics our covered to a greater extend.
> >
> > Regards,
> >
> > Rajith
> >
> >
> > On 1/17/06, Alex Andrushchak <ustas@dekasoft.com.ua > wrote:
> > >
> > > Actionally, last time i configure it to unexistent smtp server and
> > > nothing. Any errors. :-(
> > > I've put trace print into my code and everything is going fine from
> > > begin to Transport.send(message)
> > > Sorry for stupid question but how to enable debug in Geronimo?
> > >
> > > Best regards,
> > > Alex Andrushchak
> > >
> > >
> > > Rajith Attapattu wrote:
> > >
> > > Any chance that your emails were filtered by a spam filter or
> > > something.
> > >
> > > If not,
> > > First grep the log for MessagingExceptions (but I assume you have done
> > > that, bcos u mentioned no errors)
> > >
> > > Try to do the following.
> > >
> > > Enable debug and grep the log for the following
> > >
> > > "connecting to " + mail_host
> > >
> > > "connected to " + mail_host
> > >
> > > "error connecting to " + mail_host
> > >
> > > That part gives u some sort of an indication as whether connection is
> > > ok or not.
> > >
> > > After that grep for ""received : ", it will give some indication of
> > > the responses we receive from the mail server for the commands sent
> > >
> > > These are some of the things I can think of that maybe of help to you.
> > >
> > > If those thing don't help try the following
> > > ----------------------------------------------------------
> > > If u want u can  remote debug using eclipse, The class to look at is
> > > org.apache.geronimo.javamail.transport.smtp.SMTPTransport, just set a
> > > few brake points in
> > > getConnectedSocket, sendData, sendLine, receiveLine and see what
> > > happens. If u find something u can open up a JIRA :)
> > >
> > > Regards,
> > >
> > > Rajith.
> > >
> > >
> > > On 1/17/06, Alex Andrushchak <ustas@dekasoft.com.ua > wrote:
> > > >
> > > > Hi!
> > > >
> > > > I have problem with mailing from geronimo.
> > > > Mail service is configured in geronimo-application.xml :
> > > > <application
> > > >       xmlns="http://geronimo.apache.org/xml/ns/j2ee/application "
> > > >       configId="org/queryphone/Queryphone">
> > > >
> > > >    <dependency>
> > > >        <uri>geronimo/geronimo-mail/1.0</uri>
> > > >    </dependency>
> > > >
> > > >    <gbean name="jmp.smtp "
> > > > class="org.apache.geronimo.mail.SMTPTransportGBean">
> > > >        <attribute name="host"> 192.168.1.10</attribute>
> > > >        <attribute name="port">25</attribute>
> > > >        <attribute name="from"> geronimo@dekasoft.com.ua</attribute>
> > > >    </gbean>
> > > >
> > > >    <gbean name="mail/MailSession"
> > > > class="org.apache.geronimo.mail.MailGBean">
> > > >        <attribute name="transportProtocol">smtp</attribute>
> > > >        <attribute name="useDefault">true</attribute>
> > > >        <attribute name="properties">mail.debug=true </attribute>
> > > >        <reference name="Protocols">
> > > >            <name>jmp.smtp</name>
> > > >        </reference>
> > > >    </gbean>
> > > >
> > > > </application>
> > > >
> > > > Session bean that uses mail/MailSession is implemented.
> > > > When i'm trying to send e-mail everything is working without any
> > > > errors
> > > > but mail messages are not going to smtp server from geronimo.
> > > > Where i'm wrong?
> > > >
> > > > Best regards,
> > > > Alex Andrushchak
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Mime
View raw message