cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hideki tihiri <hideki.tih...@gmail.com>
Subject Re: Cocoon 2.1.11: Using org.apache.commons.mail in xsp
Date Wed, 10 Jun 2009 17:21:09 GMT
Hi,

thanks for your responses.

I used to use SendMail logicsheet (
http://cocoon.apache.org/2.1/userdocs/logicsheets/sendmail.html ) but I
thought I could not send an HTML email with it.

Now looking at your examples it could but then I should use the
sendmail:attachment like in your examples ?

Am I correct ?

Any experience with this ?

H.
On Wed, Jun 10, 2009 at 2:21 PM, Jasha Joachimsthal <
j.joachimsthal@onehippo.com> wrote:

> Hi Hideki,
>
> why would you use XSP for that? You can use the SendMailTransformer
> [1] in your pipeline. You can use both plain text and HTML mail.
>
> [1] http://cocoon.apache.org/2.2/blocks/mail/1.0/1099_1_1.html
> (documentation is for 2.2 but is also valid for 2.1)
>
> Jasha Joachimsthal
>
> j.joachimsthal@onehippo.com - jasha@apache.org
>
> www.onehippo.com
> Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
> San Francisco - Hippo USA Inc. 185 H Street, suite B, Petaluma CA
> 94952 +1 (707) 7734646
>
>
>
>
> 2009/6/10 hideki tihiri <hideki.tihiri@gmail.com>:
>  > Hi,
> >
> > I would like to use the org.apache.commons.mail package so I can easily
> send
> > HTML Emails.
> >
> > Therefore I made an xsp with following code (snippets):
> >  <?xml version="1.0" encoding="UTF-8"?>
> > <xsp:page language="java" xmlns:xsl="
> http://www.w3.org/1999/XSL/Transform"
> >           xmlns:xsp="http://apache.org/xsp"
> >           xmlns:log="http://apache.org/xsp/log/2.0"
> >           xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >           xmlns:xsp-session="http://apache.org/xsp/session/2.0"
> >           create-session="true"
> >           xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0"
> >           xmlns:util="http://apache.org/xsp/util/2.0">
> > <xsp:structure>
> >   <xsp:include>org.apache.commons.mail.*</xsp:include>
> > </xsp:structure>
> >
> > and also:
> >
> >  try {
> >     org.apache.commons.mail.HtmlEmail he = new HtmlEmail();
> >   } catch (org.apache.commons.mail.EmailException e) {
> >      throw new ProcessingException(e.getMessage());
> >   }
> >
> >
> > I added to the WEB-INF/lib the needed jars:
> > - activation-1.1.jar
> > - commons-email-1.1.jar
> >
> > When the xsp is executed (via a cronjob) I get following error:
> >
> > 10 jun 2009 13:30:00,023 [INFO ] cron {QuartzJobExecutor.java:71} -
> > Executing cron job named 'send-pressrelease'
> > 10 jun 2009 13:30:00,320 [ERROR] cron {QuartzJobExecutor.java:110} - Cron
> > job name 'send-pressrelease' died.
> > org.apache.avalon.framework.CascadingRuntimeException:
> > CocoonPipelineCronJob: send-pressrelease, raised an exception:
> >  at
> >
> org.apache.cocoon.components.cron.CocoonPipelineCronJob.execute(CocoonPipelineCronJob.java:86)
> >  at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
> >  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >  at java.lang.reflect.Method.invoke(Unknown Source)
> >  at
> >
> org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143)
> >  at $Proxy28.execute(Unknown Source)
> >  at
> >
> org.apache.cocoon.components.cron.QuartzJobExecutor.execute(QuartzJobExecutor.java:103)
> >  at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
> >  at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> > Source)
> >  at java.lang.Thread.run(Unknown Source)
> > Caused by: org.apache.excalibur.source.SourceException: Cannot get input
> > stream for cocoon://send-pressrelease
> >  at
> >
> org.apache.cocoon.components.source.impl.SitemapSource.getInputStream(SitemapSource.java:253)
> >  at
> >
> org.apache.cocoon.components.cron.CocoonPipelineCronJob.execute(CocoonPipelineCronJob.java:70)
> >  ... 9 more
> > Caused by: org.apache.cocoon.ProcessingException: Language Exception
> >  at <map:serialize> -
> >
> file:///C:/Data/Apache/webapps/betrust_internet/xmlmill/sitemap.xmap:203:24
> >  at <map:generate type="serverpages"> -
> >
> file:///C:/Data/Apache/webapps/betrust_internet/xmlmill/sitemap.xmap:198:79
> >  at
> >
> org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:380)
> >  at
> >
> org.apache.cocoon.components.source.impl.SitemapSource.<init>(SitemapSource.java:215)
> >  at
> >
> org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:65)
> >  at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
> >  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >  at java.lang.reflect.Method.invoke(Unknown Source)
> >  at
> >
> org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143)
> >  at $Proxy3.getSource(Unknown Source)
> >  at
> >
> org.apache.excalibur.source.impl.AbstractSourceResolver.resolveURI(AbstractSourceResolver.java:146)
> >  at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
> >  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> >  at java.lang.reflect.Method.invoke(Unknown Source)
> >  at
> >
> org.apache.avalon.excalibur.component.ComponentProxyGenerator$ComponentInvocationHandler.invoke(ComponentProxyGenerator.java:143)
> >  at $Proxy9.resolveURI(Unknown Source)
> >  at
> >
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
> >  at
> >
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:541)
> >  at
> >
> org.apache.cocoon.components.cron.CocoonPipelineCronJob.execute(CocoonPipelineCronJob.java:68)
> >  ... 9 more
> >
> > When I remove the code
> >
> >  try {
> >     org.apache.commons.mail.HtmlEmail he = new HtmlEmail();
> >   } catch (org.apache.commons.mail.EmailException e) {
> >      throw new ProcessingException(e.getMessage());
> >   }
> >
> > the xsp is correctly compiled.
> >
> >
> > Anyone any idea ?
> >
> > Did I understand well that with the xmlns:sendmail I can only send
> regular
> > (text) emails ?
> >
> > Regards,
> >
> > H.
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Mime
View raw message