You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Pavan Kumar <pa...@gmail.com> on 2006/04/04 14:37:25 UTC
Re: [servicemix-user] Problem in invoking a sample email component using commons-email
Hi Guillaume,
Thanks for the quick response.
I tried replacing the activation and javamail jars in servicemix with the
jars from sun.
The process went on well and the output was also fine. This worked out well
for the
3.0 snapshot, but failed in case of 2.1-snapshot with the same error "Cannot
attach file" as
mentioned earlier.
Just for the information I wanted to know , what can be the possible cause
of the error in
case of 2.1-snapshot.
Thanks,
Pavan Kumar
On 4/3/06, Guillaume Nodet <gu...@worldonline.fr> wrote:
>
> Please use the Apache mailing lists (see
> http://servicemix.org/Mailing+Lists)...
>
> I guess all your problems are related to the fact that we use geronimo
> javamail and activation jars which are not yet complete.
> You should remove the geronimo-activation and geronimo-javamail from the
> lib and optional directories in the servicemix distribution and replace
> them by Sun's ones.
>
> Cheers,
> Guillaume Nodet
>
> Pavan Kumar wrote:
>
> >
> > Hi All,
> >
> > I used the sample code from commons-email user-guide page on apache
> > site and
> > wrote a simple java class to send email with mail attachments. I made
> > this java class
> > as a servicemix POJO component which will accept a xml message.
> >
> > I prepared a small xml template to hold the mailing details like below:
> >
> > <emessage>
> > <email>
> > <mail-host>mail.mycomp.com <http://mail.mycomp.com/></mail-host>
> > <to>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > uday.garikapati@mycomp.com <ma...@mycomp.com></to>
> > <from>mailComponent@mycomp.com <ma...@mycomp.com></from>
> > <cc>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > uday.garikapati@mycomp.com <ma...@mycomp.com></cc>
> > <bcc>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > uday.garikapati@mycomp.com <ma...@mycomp.com></bcc>
> > <subject>This is subject test mail.</subject>
> > <body> This is the body content of the test mail.</body>
> > <attachments>C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf </attachments>
> > </email>
> > </emessage>
> >
> > when I tried to run this code using the "ServiceMix2.1-SNAPSHOT" the
> > problem was,
> > it was not able to attach the files to the email complaining an error
> > - org.apache.commons.mail.EmailException: Cannot attach file
> > "C:/tmp/test/att01.pdf".
> >
> > I thought this would be a problem with my java class or the file is
> > not existing,
> > so I cheked the existence of files and tried running it from within a
> > normal java code
> > and it was sending the mail correctly. I tried changing the code in
> > different ways ,but the error still persisted when I tried invoking
> > the component.
> >
> >
> > I changed my plan and tried running the same code using
> > "ServiceMix-3.0-SNAPSHOT".
> > This time everything went on well and the mail was sent successfully.
> > But when I observed
> > the mail that was recieved, it looked like some junk. On closely
> > seeing at the content I found
> > the attached pdf files are being shown as text which generally happens
> > due to setting incorrect
> > content-type or mime-type.Again I tried running the emailing code from
> > a normal java program
> > and saw the output in recieved mails and is fine showing the pdfs as
> > attachments.
> >
> >
> > Can somebody give me a idea of what is going wrong when I am trying to
> > run the code as
> > a component which is running smoothly as a normal java program.
> >
> > Here I am attaching all the esb-script, log message tracing when ran
> > with 2.0 and 3.0 SNAPSHOTS
> > and the content of the recieved mail(junk text) for the reference.
> >
> >
> > Thanks in advance,
> > Pavan Kumar
> >
> >------------------------------------------------------------------------
> >
> >
> ><========================================ESB
> SCRIPT==================================================>
> >
> ><?xml version="1.0" encoding="UTF-8"?>
> ><beans xmlns="http://xbean.org/schemas/spring/1.0"
> > xmlns:spring="http://xbean.org/schemas/spring/1.0"
> > xmlns:sm="http://servicemix.apache.org/config/1.0"
> > xmlns:foo="http://mycomp.com/test/">
> >
> > <!-- the JBI container
> > * The attribute flowName="st" makes the esb config to use single thread
> model.
> > -->
> > <sm:container id="jbi" useMBeanServer="true"
> > createMBeanServer="true" dumpStats="true" statsInterval="10"
> > flowName="st">
> >
> > <sm:activationSpecs>
> >
> > <sm:activationSpec componentName="tracer" service="foo:tracer">
> > <sm:component>
> > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > class="org.apache.servicemix.components.util.StreamWriterComponent"
> />
> > </sm:component>
> > </sm:activationSpec>
> >
> > <sm:activationSpec componentName="filePoller" service="foo:filePoller"
> destinationService="foo:emailer">
> > <sm:component>
> > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > class="
> org.apache.servicemix.components.file.FilePoller">
> > <property name="file" value="inbox"/>
> > <property name="period" value="20000"/>
> > <property name="deleteFile" value="true"/>
> > <property name="workManager" ref="workManager"/>
> > </bean>
> > </sm:component>
> > </sm:activationSpec>
> >
> > <sm:activationSpec componentName="emailer" service="foo:emailer"
> destinationService="foo:tracer">
> > <sm:component>
> > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > class="com.mycomp.esb.Emailer">
> > <property name="mailHost">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/mail-host" />
> > </bean>
> > </property>
> > <property name="to">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/to" />
> > </bean>
> > </property>
> > <property name="from">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/from" />
> > </bean>
> > </property>
> > <property name="cc">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/cc" />
> > </bean>
> > </property>
> > <property name="bcc">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/bcc" />
> > </bean>
> > </property>
> > <property name="subject">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/subject" />
> > </bean>
> > </property>
> > <property name="body">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/body" />
> > </bean>
> > </property>
> > <property name="attachments">
> > <bean class="
> org.apache.servicemix.expression.JaxenStringXPathExpression">
> > <constructor-arg
> value="/emessage/email/attachments" />
> > </bean>
> > </property>
> >
> > </bean>
> > </sm:component>
> > </sm:activationSpec>
> >
> > </sm:activationSpecs>
> >
> > </sm:container>
> >
> > <!-- the work manager (thread pool) for this container -->
> > <bean id="workManager"
> > class="org.jencks.factory.WorkManagerFactoryBean">
> > <property name="threadPoolSize" value="1" />
> > </bean>
> >
> ></beans>
> >
> >
> >
> >
> ><========================== LOG OF STACK TRACE WHEN RAN WITH
> ServiceMix2.1-SNAPSHOT ======================>
> >
> >DEBUG - FilePoller.pollFile(178) | Scheduling file inbox\email01.xml for
> processing
> >DEBUG - FilePoller.processFileAndDelete(194) | Processing file
> inbox\email01.xml
> >INFO - DeliveryChannelImpl.createExchangeFactory(165) | default
> destination serviceName for filePoller = {http://mycomp.com/test/}emailer
> >DEBUG - Broker.resolveAddress(373) | Routing exchange
> org.servicemix.jbi.messaging.InOnlyImpl@45c97b to:
> ServiceEndpoint[service={http://mycomp.com/test/}emailer,endpoint=emailer]
> >DEBUG - AbstractFlow.send(117) | Called Flow send
> >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att] - [
> mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com,
> mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com,This is test mail ., This is the body content
> of the test mail .,C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf ]
> >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> Messsages Email with Attachments ============================
> >INFO - Emailer.sendMailwithAttachments(256) |
> [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com<--->This is test mail.<---> This is the body
> content of the test mail.<--->C:/tmp/test/
> >att01.pdf|C:/tmp/test/att02.pdf ]
> >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> att01.pdf
> >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> att02.pdf
> >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> created.
> >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email has
> been set.
> >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> been set.
> >INFO - Emailer.sendMailwithAttachments(307) | subject for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(309) | message-body for email has
> been set.
> >ERROR - Emailer.sendMailwithAttachments(325) | There is problem in
> sending the mail in sendMailwithAttachments().
> >ERROR - Emailer.sendMailwithAttachments(326) |
> org.apache.commons.mail.EmailException: Cannot attach file
> "C:/tmp/test/att01.pdf"
> >Cannot attach file "C:/tmp/test/att01.pdf"
> > org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java
> :301)
> > com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java:315)
> > com.mycomp.esb.Emailer.process(Emailer.java:236)
> > org.servicemix.components.util.OutBinding.onMessageExchange(
> OutBinding.java:51)
> > org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> DeliveryChannelImpl.java:590)
> > org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:182)
> > org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > org.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java
> :124)
> > org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:289)
> > org.servicemix.jbi.container.JBIContainer.sendExchange(
> JBIContainer.java:590)
> > org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> DeliveryChannelImpl.java:349)
> > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:423)
> > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:400)
> > org.servicemix.components.file.FilePoller.processFile(
> FilePoller.java:220)
> > org.servicemix.components.file.FilePoller.processFileAndDelete(
> FilePoller.java:197)
> > org.servicemix.components.file.FilePoller$1.run(FilePoller.java
> :182)
> > org.apache.geronimo.connector.work.WorkerContext.run(
> WorkerContext.java:291)
> > EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> Source)
> > java.lang.Thread.run(Thread.java:595)
> >java.lang.UnsupportedOperationException: Method not yet implemented
> >Method not yet implemented
> >javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:167)
> >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:432)
> >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:292)
> >com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java:315)
> >com.mycomp.esb.Emailer.process(Emailer.java:236)
> >org.servicemix.components.util.OutBinding.onMessageExchange(
> OutBinding.java:51)
> >org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> DeliveryChannelImpl.java:590)
> >org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:182)
> >org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> >org.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:124)
> >org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:289)
> >org.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java
> :590)
> >org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> DeliveryChannelImpl.java:349)
> >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:423)
> >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:400)
> >org.servicemix.components.file.FilePoller.processFile(FilePoller.java
> :220)
> >org.servicemix.components.file.FilePoller.processFileAndDelete(
> FilePoller.java:197)
> >org.servicemix.components.file.FilePoller$1.run(FilePoller.java:182)
> >org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> :291)
> >EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> Source)
> >java.lang.Thread.run(Thread.java:595)
> >
> >INFO - Emailer.sendMailwithAttachments(329) |
> ===========================================================================================
> >ERROR - PojoSupport.fail(254) | Error processing exchange
> >java.lang.Exception: Problem occured while sending the email.Contactyour admin.
> > at com.mycomp.esb.Emailer.process(Emailer.java:242)
> > at org.servicemix.components.util.OutBinding.onMessageExchange(
> OutBinding.java:51)
> > at
> org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> DeliveryChannelImpl.java:590)
> > at org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:182)
> > at org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > at org.servicemix.jbi.nmr.flow.AbstractFlow.send(
> AbstractFlow.java:124)
> > at org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java
> :289)
> > at org.servicemix.jbi.container.JBIContainer.sendExchange(
> JBIContainer.java:590)
> > at org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> DeliveryChannelImpl.java:349)
> > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:423)
> > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> DeliveryChannelImpl.java:400)
> > at org.servicemix.components.file.FilePoller.processFile(
> FilePoller.java:220)
> > at org.servicemix.components.file.FilePoller.processFileAndDelete
> (FilePoller.java:197)
> > at org.servicemix.components.file.FilePoller$1.run(
> FilePoller.java:182)
> > at org.apache.geronimo.connector.work.WorkerContext.run(
> WorkerContext.java:291)
> > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> Source)
> > at java.lang.Thread.run(Thread.java:595)
> >DEBUG - AbstractFlow.send(117) | Called Flow send
> >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> >
> >
> >
> >
> >
> ><=====================================LOG OF STACK TRACE WHEN RAN WITH
> ServiceMix-3.0-SNAPSHOT========================>
> >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> >DEBUG - FilePoller.pollFile(165) | Scheduling file inbox\email01.xml for
> processing
> >DEBUG - FilePoller.processFileAndDelete(181) | Processing file
> inbox\email01.xml
> >DEBUG - Broker.resolveAddress(388) | Routing exchange
> org.apache.servicemix.jbi.messaging.InOnlyImpl@19ecd80 to:
> ServiceEndpoint[service={http://mycomp.com/test/}emailer,endpoint=emailer]
> >DEBUG - AbstractFlow.send(116) | Called Flow send
> >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att] - [
> mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com,
> mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com,This is test mail ., This is the body content
> of the test mail .,C:/tmp/test/o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> Messsages Email with Attachments ============================
> >INFO - Emailer.sendMailwithAttachments(256) |
> [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> uday.garikapati@mycomp.com<--->This is test mail .<---> This is the body
> content of the test mail .<--->C:/tmp/test/
> >o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> o2791450.pdf
> >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> o2791453.pdf
> >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> created.
> >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email has
> been set.
> >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> been set.
> >INFO - Emailer.sendMailwithAttachments(307) | subject for email has been
> set.
> >INFO - Emailer.sendMailwithAttachments(309) | message-body for email has
> been set.
> >1 name = META-INF/mime.types
> > attachement added to mail.
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> >INFO - Emailer.sendMailwithAttachments(321) | email has been sent
> successfully.
> >INFO - Emailer.sendMailwithAttachments(329) |
> ===========================================================================================
> >DEBUG - AbstractFlow.send(116) | Called Flow send
> >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> >
> >
> >
> >
> >
> >
> >
> >
> ><=========================================== JUNK CONTENT RECIVED WHEN
> USED ServiceMix-3.0-SNAPSHOT===================================================>
> >
> >------=_Part_0.1144073440659
> >
> > This is the body content of the test mail .
> >------=_Part_0.1144073440659
> >content-disposition:attachment; filename=o2791450.pdf
> >content-description:mail attachment
> >
> >%PDF-1.4
> >%âãÏÓ
> >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> ÂÝ‚.üçPpUæÉ
> nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> ><Ý߯0éüÕoåá
> >endstream
> >endobj
> >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet [/PDF
> /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612 792]>>
> >endobj
> >1 0
> obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> >endobj
> >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> >endobj
> >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> >endobj
> >6 0 obj<</CreationDate(D:20060317215521+05'30')/Producer(iText1.1 by
> lowagie.com \(based on
> itext-paulo-142\))/ModDate(D:20060317215521+05'30')>>
> >endobj
> >xref
> >0 7
> >0000000000 65535 f
> >0000000880 00000 n
> >0000000015 00000 n
> >0000000965 00000 n
> >0000000724 00000 n
> >0000001015 00000 n
> >0000001059 00000 n
> >trailer
> ><</ID
> [<c0442af2fe3f7656f46bba0efb7d408a><c0442af2fe3f7656f46bba0efb7d408a>]/Root
> 5 0 R/Size 7/Info 6 0 R>>
> >startxref
> >1212
> >%%EOF
> >
> >------=_Part_0.1144073440659
> >content-disposition:attachment; filename="o2791453.pdf "
> >content-description:mail attachment
> >
> >%PDF-1.4
> >%âãÏÓ
> >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> ÂÝ‚.üçPpUæÉ
> nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> ><Ý߯0éüÕoåá
> >endstream
> >endobj
> >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet [/PDF
> /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612 792]>>
> >endobj
> >1 0
> obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> >endobj
> >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> >endobj
> >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> >endobj
> >6 0 obj<</CreationDate(D:20060317221145+05'30')/Producer(iText1.1 by
> lowagie.com \(based on
> itext-paulo-142\))/ModDate(D:20060317221145+05'30')>>
> >endobj
> >xref
> >0 7
> >0000000000 65535 f
> >0000000880 00000 n
> >0000000015 00000 n
> >0000000965 00000 n
> >0000000724 00000 n
> >0000001015 00000 n
> >0000001059 00000 n
> >trailer
> ><</ID
> [<e37d8ca05c4626b86470e062e25ba884><e37d8ca05c4626b86470e062e25ba884>]/Root
> 5 0 R/Size 7/Info 6 0 R>>
> >startxref
> >1212
> >%%EOF
> >
> >------=_Part_0.1144073440659--
> >
> >
> >
> >
>
Re: [servicemix-user] Problem in invoking a sample email component using commons-email
Posted by Pavan Kumar <pa...@gmail.com>.
Hi Guillaume,
I dont have much idea of the jira and test cases.
I have a prepared a simple test case and attaching the
esb scripts for 2.1,3.0 snapshots, the generated logs,
the emailer component code.
Chek if these are useful in fixing the problem.
Feel free to ask any queries regarding the stuff
that I am sending.
Thanks,
Pavan kumar
On 4/5/06, Guillaume Nodet <gn...@gmail.com> wrote:
>
> Hi Pavan !
>
> Glad it now works for you.
> I think that the behavior difference between your 2.1-SNAPSHOT (nobody
> should use it, really) and the 3.0-SNAPSHOT is due to the fact that we
> use an updated version of the javamail and activation jars from
> Geronimo. If you look at the stack trace for 2.1, you will see a
> java.lang.UnsupportedOperationException: Method not yet implemented
> when calling javax.mail.internet.MimeBodyPart.setFileName. This has
> been implemented in the version that ships with Geronimo, but it seems
> it does not fully work yet.
>
> Do you have a simple test case we could try to fix ?
> In such a case, would you mind creating a jira issue and attach it (or
> send it to me if needed).
>
> Thanks a lot,
> Guillaume Nodet
>
> On 4/4/06, Pavan Kumar <pa...@gmail.com> wrote:
> > Hi Guillaume,
> >
> > Thanks for the quick response.
> >
> > I tried replacing the activation and javamail jars in servicemix with
> the
> > jars from sun.
> > The process went on well and the output was also fine. This worked out
> well
> > for the
> > 3.0 snapshot, but failed in case of 2.1-snapshot with the same error
> "Cannot
> > attach file" as
> > mentioned earlier.
> >
> > Just for the information I wanted to know , what can be the possible
> cause
> > of the error in
> > case of 2.1-snapshot.
> >
> > Thanks,
> > Pavan Kumar
> >
> >
> >
> >
> > On 4/3/06, Guillaume Nodet <gu...@worldonline.fr> wrote:
> > >
> > > Please use the Apache mailing lists (see
> > > http://servicemix.org/Mailing+Lists)...
> > >
> > > I guess all your problems are related to the fact that we use geronimo
> > > javamail and activation jars which are not yet complete.
> > > You should remove the geronimo-activation and geronimo-javamail from
> the
> > > lib and optional directories in the servicemix distribution and
> replace
> > > them by Sun's ones.
> > >
> > > Cheers,
> > > Guillaume Nodet
> > >
> > > Pavan Kumar wrote:
> > >
> > > >
> > > > Hi All,
> > > >
> > > > I used the sample code from commons-email user-guide page on apache
> > > > site and
> > > > wrote a simple java class to send email with mail attachments. I
> made
> > > > this java class
> > > > as a servicemix POJO component which will accept a xml message.
> > > >
> > > > I prepared a small xml template to hold the mailing details like
> below:
> > > >
> > > > <emessage>
> > > > <email>
> > > > <mail-host>mail.mycomp.com <http://mail.mycomp.com/></mail-host>
> > > > <to>pavan.ramadugula@mycomp.com <mailto:pavan.ramadugula@mycomp.com
> >,
> > > > uday.garikapati@mycomp.com <ma...@mycomp.com></to>
> > > > <from>mailComponent@mycomp.com <mailto:mailComponent@mycomp.com
> ></from>
> > > > <cc>pavan.ramadugula@mycomp.com <mailto:pavan.ramadugula@mycomp.com
> >,
> > > > uday.garikapati@mycomp.com <ma...@mycomp.com></cc>
> > > > <bcc>pavan.ramadugula@mycomp.com <mailto:pavan.ramadugula@mycomp.com
> >,
> > > > uday.garikapati@mycomp.com <ma...@mycomp.com></bcc>
> > > > <subject>This is subject test mail.</subject>
> > > > <body> This is the body content of the test mail.</body>
> > > > <attachments>C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf
> </attachments>
> > > > </email>
> > > > </emessage>
> > > >
> > > > when I tried to run this code using the "ServiceMix2.1-SNAPSHOT" the
> > > > problem was,
> > > > it was not able to attach the files to the email complaining an
> error
> > > > - org.apache.commons.mail.EmailException: Cannot attach file
> > > > "C:/tmp/test/att01.pdf".
> > > >
> > > > I thought this would be a problem with my java class or the file is
> > > > not existing,
> > > > so I cheked the existence of files and tried running it from within
> a
> > > > normal java code
> > > > and it was sending the mail correctly. I tried changing the code in
> > > > different ways ,but the error still persisted when I tried invoking
> > > > the component.
> > > >
> > > >
> > > > I changed my plan and tried running the same code using
> > > > "ServiceMix-3.0-SNAPSHOT".
> > > > This time everything went on well and the mail was sent
> successfully.
> > > > But when I observed
> > > > the mail that was recieved, it looked like some junk. On closely
> > > > seeing at the content I found
> > > > the attached pdf files are being shown as text which generally
> happens
> > > > due to setting incorrect
> > > > content-type or mime-type.Again I tried running the emailing code
> from
> > > > a normal java program
> > > > and saw the output in recieved mails and is fine showing the pdfs as
> > > > attachments.
> > > >
> > > >
> > > > Can somebody give me a idea of what is going wrong when I am trying
> to
> > > > run the code as
> > > > a component which is running smoothly as a normal java program.
> > > >
> > > > Here I am attaching all the esb-script, log message tracing when ran
> > > > with 2.0 and 3.0 SNAPSHOTS
> > > > and the content of the recieved mail(junk text) for the reference.
> > > >
> > > >
> > > > Thanks in advance,
> > > > Pavan Kumar
> > > >
> > >
> >------------------------------------------------------------------------
> > > >
> > > >
> > > ><========================================ESB
> > > SCRIPT==================================================>
> > > >
> > > ><?xml version="1.0" encoding="UTF-8"?>
> > > ><beans xmlns="http://xbean.org/schemas/spring/1.0"
> > > > xmlns:spring="http://xbean.org/schemas/spring/1.0"
> > > > xmlns:sm="http://servicemix.apache.org/config/1.0"
> > > > xmlns:foo="http://mycomp.com/test/">
> > > >
> > > > <!-- the JBI container
> > > > * The attribute flowName="st" makes the esb config to use single
> thread
> > > model.
> > > > -->
> > > > <sm:container id="jbi" useMBeanServer="true"
> > > > createMBeanServer="true" dumpStats="true" statsInterval="10"
> > > > flowName="st">
> > > >
> > > > <sm:activationSpecs>
> > > >
> > > > <sm:activationSpec componentName="tracer" service="foo:tracer">
> > > > <sm:component>
> > > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > > class="
> org.apache.servicemix.components.util.StreamWriterComponent"
> > > />
> > > > </sm:component>
> > > > </sm:activationSpec>
> > > >
> > > > <sm:activationSpec componentName="filePoller"
> service="foo:filePoller"
> > > destinationService="foo:emailer">
> > > > <sm:component>
> > > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > > class="
> > > org.apache.servicemix.components.file.FilePoller">
> > > > <property name="file" value="inbox"/>
> > > > <property name="period" value="20000"/>
> > > > <property name="deleteFile" value="true"/>
> > > > <property name="workManager"
> ref="workManager"/>
> > > > </bean>
> > > > </sm:component>
> > > > </sm:activationSpec>
> > > >
> > > > <sm:activationSpec componentName="emailer" service="foo:emailer"
> > > destinationService="foo:tracer">
> > > > <sm:component>
> > > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > > class="com.mycomp.esb.Emailer">
> > > > <property name="mailHost">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/mail-host" />
> > > > </bean>
> > > > </property>
> > > > <property name="to">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/to" />
> > > > </bean>
> > > > </property>
> > > > <property name="from">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/from" />
> > > > </bean>
> > > > </property>
> > > > <property name="cc">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/cc" />
> > > > </bean>
> > > > </property>
> > > > <property name="bcc">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/bcc" />
> > > > </bean>
> > > > </property>
> > > > <property name="subject">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/subject" />
> > > > </bean>
> > > > </property>
> > > > <property name="body">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/body" />
> > > > </bean>
> > > > </property>
> > > > <property name="attachments">
> > > > <bean class="
> > > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > > <constructor-arg
> > > value="/emessage/email/attachments" />
> > > > </bean>
> > > > </property>
> > > >
> > > > </bean>
> > > > </sm:component>
> > > > </sm:activationSpec>
> > > >
> > > > </sm:activationSpecs>
> > > >
> > > > </sm:container>
> > > >
> > > > <!-- the work manager (thread pool) for this container -->
> > > > <bean id="workManager"
> > > > class="org.jencks.factory.WorkManagerFactoryBean">
> > > > <property name="threadPoolSize" value="1" />
> > > > </bean>
> > > >
> > > ></beans>
> > > >
> > > >
> > > >
> > > >
> > > ><========================== LOG OF STACK TRACE WHEN RAN WITH
> > > ServiceMix2.1-SNAPSHOT ======================>
> > > >
> > > >DEBUG - FilePoller.pollFile(178) | Scheduling file inbox\email01.xml
> for
> > > processing
> > > >DEBUG - FilePoller.processFileAndDelete(194) | Processing file
> > > inbox\email01.xml
> > > >INFO - DeliveryChannelImpl.createExchangeFactory(165) | default
> > > destination serviceName for filePoller = {
> http://mycomp.com/test/}emailer
> > > >DEBUG - Broker.resolveAddress(373) | Routing exchange
> > > org.servicemix.jbi.messaging.InOnlyImpl@45c97b to:
> > > ServiceEndpoint[service={
> http://mycomp.com/test/}emailer,endpoint=emailer]
> > > >DEBUG - AbstractFlow.send(117) | Called Flow send
> > > >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> > > >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att]
> - [
> > > mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com
> ,
> > > mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com,This is test mail ., This is the body
> content
> > > of the test mail .,C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf ]
> > > >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> > > Messsages Email with Attachments ============================
> > > >INFO - Emailer.sendMailwithAttachments(256) |
> > > [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> > > pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> > > mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com<--->This is test mail.<---> This is the
> body
> > > content of the test mail.<--->C:/tmp/test/
> > > >att01.pdf|C:/tmp/test/att02.pdf ]
> > > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > > att01.pdf
> > > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > > att02.pdf
> > > >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> > > created.
> > > >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email
> has
> > > been set.
> > > >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> > > been set.
> > > >INFO - Emailer.sendMailwithAttachments(307) | subject for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(309) | message-body for email
> has
> > > been set.
> > > >ERROR - Emailer.sendMailwithAttachments(325) | There is problem in
> > > sending the mail in sendMailwithAttachments().
> > > >ERROR - Emailer.sendMailwithAttachments(326) |
> > > org.apache.commons.mail.EmailException: Cannot attach file
> > > "C:/tmp/test/att01.pdf"
> > > >Cannot attach file "C:/tmp/test/att01.pdf"
> > > > org.apache.commons.mail.MultiPartEmail.attach(
> MultiPartEmail.java
> > > :301)
> > > > com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java
> :315)
> > > > com.mycomp.esb.Emailer.process(Emailer.java:236)
> > > > org.servicemix.components.util.OutBinding.onMessageExchange(
> > > OutBinding.java:51)
> > > >
> org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > > DeliveryChannelImpl.java:590)
> > > > org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> > > AbstractFlow.java:182)
> > > > org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > > > org.servicemix.jbi.nmr.flow.AbstractFlow.send(
> AbstractFlow.java
> > > :124)
> > > > org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java
> :289)
> > > > org.servicemix.jbi.container.JBIContainer.sendExchange(
> > > JBIContainer.java:590)
> > > > org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > > DeliveryChannelImpl.java:349)
> > > > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:423)
> > > > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:400)
> > > > org.servicemix.components.file.FilePoller.processFile(
> > > FilePoller.java:220)
> > > >
> org.servicemix.components.file.FilePoller.processFileAndDelete(
> > > FilePoller.java:197)
> > > > org.servicemix.components.file.FilePoller$1.run(
> FilePoller.java
> > > :182)
> > > > org.apache.geronimo.connector.work.WorkerContext.run(
> > > WorkerContext.java:291)
> > > > EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
> (Unknown
> > > Source)
> > > > java.lang.Thread.run(Thread.java:595)
> > > >java.lang.UnsupportedOperationException: Method not yet implemented
> > > >Method not yet implemented
> > > >javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:167)
> > > >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java
> :432)
> > > >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java
> :292)
> > > >com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java:315)
> > > >com.mycomp.esb.Emailer.process(Emailer.java:236)
> > > >org.servicemix.components.util.OutBinding.onMessageExchange(
> > > OutBinding.java:51)
> > > >org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > > DeliveryChannelImpl.java:590)
> > > >org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java
> :182)
> > > >org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > > >org.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:124)
> > > >org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:289)
> > > >org.servicemix.jbi.container.JBIContainer.sendExchange(
> JBIContainer.java
> > > :590)
> > > >org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > > DeliveryChannelImpl.java:349)
> > > >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:423)
> > > >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:400)
> > > >org.servicemix.components.file.FilePoller.processFile(FilePoller.java
> > > :220)
> > > >org.servicemix.components.file.FilePoller.processFileAndDelete(
> > > FilePoller.java:197)
> > > >org.servicemix.components.file.FilePoller$1.run(FilePoller.java:182)
> > > >org.apache.geronimo.connector.work.WorkerContext.run(
> WorkerContext.java
> > > :291)
> > > >EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> > > Source)
> > > >java.lang.Thread.run(Thread.java:595)
> > > >
> > > >INFO - Emailer.sendMailwithAttachments(329) |
> > >
> ===========================================================================================
> > > >ERROR - PojoSupport.fail(254) | Error processing exchange
> > > >java.lang.Exception: Problem occured while sending the
> email.Contactyour admin.
> > > > at com.mycomp.esb.Emailer.process(Emailer.java:242)
> > > > at
> org.servicemix.components.util.OutBinding.onMessageExchange(
> > > OutBinding.java:51)
> > > > at
> > > org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > > DeliveryChannelImpl.java:590)
> > > > at org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> > > AbstractFlow.java:182)
> > > > at org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java
> :45)
> > > > at org.servicemix.jbi.nmr.flow.AbstractFlow.send(
> > > AbstractFlow.java:124)
> > > > at org.servicemix.jbi.nmr.Broker.sendExchangePacket(
> Broker.java
> > > :289)
> > > > at org.servicemix.jbi.container.JBIContainer.sendExchange(
> > > JBIContainer.java:590)
> > > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > > DeliveryChannelImpl.java:349)
> > > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:423)
> > > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > > DeliveryChannelImpl.java:400)
> > > > at org.servicemix.components.file.FilePoller.processFile(
> > > FilePoller.java:220)
> > > > at
> org.servicemix.components.file.FilePoller.processFileAndDelete
> > > (FilePoller.java:197)
> > > > at org.servicemix.components.file.FilePoller$1.run(
> > > FilePoller.java:182)
> > > > at org.apache.geronimo.connector.work.WorkerContext.run(
> > > WorkerContext.java:291)
> > > > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run
> (Unknown
> > > Source)
> > > > at java.lang.Thread.run(Thread.java:595)
> > > >DEBUG - AbstractFlow.send(117) | Called Flow send
> > > >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> > > >
> > > >
> > > >
> > > >
> > > >
> > > ><=====================================LOG OF STACK TRACE WHEN RAN
> WITH
> > > ServiceMix-3.0-SNAPSHOT========================>
> > > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > > >DEBUG - FilePoller.pollFile(165) | Scheduling file inbox\email01.xml
> for
> > > processing
> > > >DEBUG - FilePoller.processFileAndDelete(181) | Processing file
> > > inbox\email01.xml
> > > >DEBUG - Broker.resolveAddress(388) | Routing exchange
> > > org.apache.servicemix.jbi.messaging.InOnlyImpl@19ecd80 to:
> > > ServiceEndpoint[service={
> http://mycomp.com/test/}emailer,endpoint=emailer]
> > > >DEBUG - AbstractFlow.send(116) | Called Flow send
> > > >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> > > >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att]
> - [
> > > mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com
> ,
> > > mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com,This is test mail ., This is the body
> content
> > > of the test mail .,C:/tmp/test/o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> > > >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> > > Messsages Email with Attachments ============================
> > > >INFO - Emailer.sendMailwithAttachments(256) |
> > > [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> > > pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> > > mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > > uday.garikapati@mycomp.com<--->This is test mail .<---> This is the
> body
> > > content of the test mail .<--->C:/tmp/test/
> > > >o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> > > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > > o2791450.pdf
> > > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > > o2791453.pdf
> > > >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> > > created.
> > > >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email
> has
> > > been set.
> > > >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> > > been set.
> > > >INFO - Emailer.sendMailwithAttachments(307) | subject for email has
> been
> > > set.
> > > >INFO - Emailer.sendMailwithAttachments(309) | message-body for email
> has
> > > been set.
> > > >1 name = META-INF/mime.types
> > > > attachement added to mail.
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > > >INFO - Emailer.sendMailwithAttachments(321) | email has been sent
> > > successfully.
> > > >INFO - Emailer.sendMailwithAttachments(329) |
> > >
> ===========================================================================================
> > > >DEBUG - AbstractFlow.send(116) | Called Flow send
> > > >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > ><=========================================== JUNK CONTENT RECIVED
> WHEN
> > > USED
> ServiceMix-3.0-SNAPSHOT===================================================
> >
> > > >
> > > >------=_Part_0.1144073440659
> > > >
> > > > This is the body content of the test mail .
> > > >------=_Part_0.1144073440659
> > > >content-disposition:attachment; filename=o2791450.pdf
> > > >content-description:mail attachment
> > > >
> > > >%PDF-1.4
> > > >%âãÏÓ
> > > >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> > >
> >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> > > ÂÝ‚.üçPpUæÉ
> > >
> nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> > > >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> > >
> (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> > > &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> > > ><Ý߯0éüÕoåá
> > > >endstream
> > > >endobj
> > > >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet
> [/PDF
> > > /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612
> 792]>>
> > > >endobj
> > > >1 0
> > >
> obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> > > >endobj
> > > >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> > > >endobj
> > > >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> > > >endobj
> > > >6 0 obj<</CreationDate(D:20060317215521+05'30')/Producer(iText1.1 by
> > > lowagie.com \(based on
> > > itext-paulo-142\))/ModDate(D:20060317215521+05'30')>>
> > > >endobj
> > > >xref
> > > >0 7
> > > >0000000000 65535 f
> > > >0000000880 00000 n
> > > >0000000015 00000 n
> > > >0000000965 00000 n
> > > >0000000724 00000 n
> > > >0000001015 00000 n
> > > >0000001059 00000 n
> > > >trailer
> > > ><</ID
> > >
> [<c0442af2fe3f7656f46bba0efb7d408a><c0442af2fe3f7656f46bba0efb7d408a>]/Root
> > > 5 0 R/Size 7/Info 6 0 R>>
> > > >startxref
> > > >1212
> > > >%%EOF
> > > >
> > > >------=_Part_0.1144073440659
> > > >content-disposition:attachment; filename="o2791453.pdf "
> > > >content-description:mail attachment
> > > >
> > > >%PDF-1.4
> > > >%âãÏÓ
> > > >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> > >
> >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> > > ÂÝ‚.üçPpUæÉ
> > >
> nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> > > >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> > >
> (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> > > &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> > > ><Ý߯0éüÕoåá
> > > >endstream
> > > >endobj
> > > >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet
> [/PDF
> > > /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612
> 792]>>
> > > >endobj
> > > >1 0
> > >
> obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> > > >endobj
> > > >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> > > >endobj
> > > >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> > > >endobj
> > > >6 0 obj<</CreationDate(D:20060317221145+05'30')/Producer(iText1.1 by
> > > lowagie.com \(based on
> > > itext-paulo-142\))/ModDate(D:20060317221145+05'30')>>
> > > >endobj
> > > >xref
> > > >0 7
> > > >0000000000 65535 f
> > > >0000000880 00000 n
> > > >0000000015 00000 n
> > > >0000000965 00000 n
> > > >0000000724 00000 n
> > > >0000001015 00000 n
> > > >0000001059 00000 n
> > > >trailer
> > > ><</ID
> > >
> [<e37d8ca05c4626b86470e062e25ba884><e37d8ca05c4626b86470e062e25ba884>]/Root
> > > 5 0 R/Size 7/Info 6 0 R>>
> > > >startxref
> > > >1212
> > > >%%EOF
> > > >
> > > >------=_Part_0.1144073440659--
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
Re: [servicemix-user] Problem in invoking a sample email component using commons-email
Posted by Guillaume Nodet <gn...@gmail.com>.
Hi Pavan !
Glad it now works for you.
I think that the behavior difference between your 2.1-SNAPSHOT (nobody
should use it, really) and the 3.0-SNAPSHOT is due to the fact that we
use an updated version of the javamail and activation jars from
Geronimo. If you look at the stack trace for 2.1, you will see a
java.lang.UnsupportedOperationException: Method not yet implemented
when calling javax.mail.internet.MimeBodyPart.setFileName. This has
been implemented in the version that ships with Geronimo, but it seems
it does not fully work yet.
Do you have a simple test case we could try to fix ?
In such a case, would you mind creating a jira issue and attach it (or
send it to me if needed).
Thanks a lot,
Guillaume Nodet
On 4/4/06, Pavan Kumar <pa...@gmail.com> wrote:
> Hi Guillaume,
>
> Thanks for the quick response.
>
> I tried replacing the activation and javamail jars in servicemix with the
> jars from sun.
> The process went on well and the output was also fine. This worked out well
> for the
> 3.0 snapshot, but failed in case of 2.1-snapshot with the same error "Cannot
> attach file" as
> mentioned earlier.
>
> Just for the information I wanted to know , what can be the possible cause
> of the error in
> case of 2.1-snapshot.
>
> Thanks,
> Pavan Kumar
>
>
>
>
> On 4/3/06, Guillaume Nodet <gu...@worldonline.fr> wrote:
> >
> > Please use the Apache mailing lists (see
> > http://servicemix.org/Mailing+Lists)...
> >
> > I guess all your problems are related to the fact that we use geronimo
> > javamail and activation jars which are not yet complete.
> > You should remove the geronimo-activation and geronimo-javamail from the
> > lib and optional directories in the servicemix distribution and replace
> > them by Sun's ones.
> >
> > Cheers,
> > Guillaume Nodet
> >
> > Pavan Kumar wrote:
> >
> > >
> > > Hi All,
> > >
> > > I used the sample code from commons-email user-guide page on apache
> > > site and
> > > wrote a simple java class to send email with mail attachments. I made
> > > this java class
> > > as a servicemix POJO component which will accept a xml message.
> > >
> > > I prepared a small xml template to hold the mailing details like below:
> > >
> > > <emessage>
> > > <email>
> > > <mail-host>mail.mycomp.com <http://mail.mycomp.com/></mail-host>
> > > <to>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > > uday.garikapati@mycomp.com <ma...@mycomp.com></to>
> > > <from>mailComponent@mycomp.com <ma...@mycomp.com></from>
> > > <cc>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > > uday.garikapati@mycomp.com <ma...@mycomp.com></cc>
> > > <bcc>pavan.ramadugula@mycomp.com <ma...@mycomp.com>,
> > > uday.garikapati@mycomp.com <ma...@mycomp.com></bcc>
> > > <subject>This is subject test mail.</subject>
> > > <body> This is the body content of the test mail.</body>
> > > <attachments>C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf </attachments>
> > > </email>
> > > </emessage>
> > >
> > > when I tried to run this code using the "ServiceMix2.1-SNAPSHOT" the
> > > problem was,
> > > it was not able to attach the files to the email complaining an error
> > > - org.apache.commons.mail.EmailException: Cannot attach file
> > > "C:/tmp/test/att01.pdf".
> > >
> > > I thought this would be a problem with my java class or the file is
> > > not existing,
> > > so I cheked the existence of files and tried running it from within a
> > > normal java code
> > > and it was sending the mail correctly. I tried changing the code in
> > > different ways ,but the error still persisted when I tried invoking
> > > the component.
> > >
> > >
> > > I changed my plan and tried running the same code using
> > > "ServiceMix-3.0-SNAPSHOT".
> > > This time everything went on well and the mail was sent successfully.
> > > But when I observed
> > > the mail that was recieved, it looked like some junk. On closely
> > > seeing at the content I found
> > > the attached pdf files are being shown as text which generally happens
> > > due to setting incorrect
> > > content-type or mime-type.Again I tried running the emailing code from
> > > a normal java program
> > > and saw the output in recieved mails and is fine showing the pdfs as
> > > attachments.
> > >
> > >
> > > Can somebody give me a idea of what is going wrong when I am trying to
> > > run the code as
> > > a component which is running smoothly as a normal java program.
> > >
> > > Here I am attaching all the esb-script, log message tracing when ran
> > > with 2.0 and 3.0 SNAPSHOTS
> > > and the content of the recieved mail(junk text) for the reference.
> > >
> > >
> > > Thanks in advance,
> > > Pavan Kumar
> > >
> > >------------------------------------------------------------------------
> > >
> > >
> > ><========================================ESB
> > SCRIPT==================================================>
> > >
> > ><?xml version="1.0" encoding="UTF-8"?>
> > ><beans xmlns="http://xbean.org/schemas/spring/1.0"
> > > xmlns:spring="http://xbean.org/schemas/spring/1.0"
> > > xmlns:sm="http://servicemix.apache.org/config/1.0"
> > > xmlns:foo="http://mycomp.com/test/">
> > >
> > > <!-- the JBI container
> > > * The attribute flowName="st" makes the esb config to use single thread
> > model.
> > > -->
> > > <sm:container id="jbi" useMBeanServer="true"
> > > createMBeanServer="true" dumpStats="true" statsInterval="10"
> > > flowName="st">
> > >
> > > <sm:activationSpecs>
> > >
> > > <sm:activationSpec componentName="tracer" service="foo:tracer">
> > > <sm:component>
> > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > class="org.apache.servicemix.components.util.StreamWriterComponent"
> > />
> > > </sm:component>
> > > </sm:activationSpec>
> > >
> > > <sm:activationSpec componentName="filePoller" service="foo:filePoller"
> > destinationService="foo:emailer">
> > > <sm:component>
> > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > class="
> > org.apache.servicemix.components.file.FilePoller">
> > > <property name="file" value="inbox"/>
> > > <property name="period" value="20000"/>
> > > <property name="deleteFile" value="true"/>
> > > <property name="workManager" ref="workManager"/>
> > > </bean>
> > > </sm:component>
> > > </sm:activationSpec>
> > >
> > > <sm:activationSpec componentName="emailer" service="foo:emailer"
> > destinationService="foo:tracer">
> > > <sm:component>
> > > <bean xmlns="http://xbean.org/schemas/spring/1.0"
> > > class="com.mycomp.esb.Emailer">
> > > <property name="mailHost">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/mail-host" />
> > > </bean>
> > > </property>
> > > <property name="to">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/to" />
> > > </bean>
> > > </property>
> > > <property name="from">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/from" />
> > > </bean>
> > > </property>
> > > <property name="cc">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/cc" />
> > > </bean>
> > > </property>
> > > <property name="bcc">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/bcc" />
> > > </bean>
> > > </property>
> > > <property name="subject">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/subject" />
> > > </bean>
> > > </property>
> > > <property name="body">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/body" />
> > > </bean>
> > > </property>
> > > <property name="attachments">
> > > <bean class="
> > org.apache.servicemix.expression.JaxenStringXPathExpression">
> > > <constructor-arg
> > value="/emessage/email/attachments" />
> > > </bean>
> > > </property>
> > >
> > > </bean>
> > > </sm:component>
> > > </sm:activationSpec>
> > >
> > > </sm:activationSpecs>
> > >
> > > </sm:container>
> > >
> > > <!-- the work manager (thread pool) for this container -->
> > > <bean id="workManager"
> > > class="org.jencks.factory.WorkManagerFactoryBean">
> > > <property name="threadPoolSize" value="1" />
> > > </bean>
> > >
> > ></beans>
> > >
> > >
> > >
> > >
> > ><========================== LOG OF STACK TRACE WHEN RAN WITH
> > ServiceMix2.1-SNAPSHOT ======================>
> > >
> > >DEBUG - FilePoller.pollFile(178) | Scheduling file inbox\email01.xml for
> > processing
> > >DEBUG - FilePoller.processFileAndDelete(194) | Processing file
> > inbox\email01.xml
> > >INFO - DeliveryChannelImpl.createExchangeFactory(165) | default
> > destination serviceName for filePoller = {http://mycomp.com/test/}emailer
> > >DEBUG - Broker.resolveAddress(373) | Routing exchange
> > org.servicemix.jbi.messaging.InOnlyImpl@45c97b to:
> > ServiceEndpoint[service={http://mycomp.com/test/}emailer,endpoint=emailer]
> > >DEBUG - AbstractFlow.send(117) | Called Flow send
> > >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> > >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att] - [
> > mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com,
> > mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com,This is test mail ., This is the body content
> > of the test mail .,C:/tmp/test/att01.pdf|C:/tmp/test/att02.pdf ]
> > >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> > Messsages Email with Attachments ============================
> > >INFO - Emailer.sendMailwithAttachments(256) |
> > [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> > pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> > mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com<--->This is test mail.<---> This is the body
> > content of the test mail.<--->C:/tmp/test/
> > >att01.pdf|C:/tmp/test/att02.pdf ]
> > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > att01.pdf
> > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > att02.pdf
> > >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> > created.
> > >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email has
> > been set.
> > >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> > been set.
> > >INFO - Emailer.sendMailwithAttachments(307) | subject for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(309) | message-body for email has
> > been set.
> > >ERROR - Emailer.sendMailwithAttachments(325) | There is problem in
> > sending the mail in sendMailwithAttachments().
> > >ERROR - Emailer.sendMailwithAttachments(326) |
> > org.apache.commons.mail.EmailException: Cannot attach file
> > "C:/tmp/test/att01.pdf"
> > >Cannot attach file "C:/tmp/test/att01.pdf"
> > > org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java
> > :301)
> > > com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java:315)
> > > com.mycomp.esb.Emailer.process(Emailer.java:236)
> > > org.servicemix.components.util.OutBinding.onMessageExchange(
> > OutBinding.java:51)
> > > org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > DeliveryChannelImpl.java:590)
> > > org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> > AbstractFlow.java:182)
> > > org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > > org.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java
> > :124)
> > > org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:289)
> > > org.servicemix.jbi.container.JBIContainer.sendExchange(
> > JBIContainer.java:590)
> > > org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > DeliveryChannelImpl.java:349)
> > > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:423)
> > > org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:400)
> > > org.servicemix.components.file.FilePoller.processFile(
> > FilePoller.java:220)
> > > org.servicemix.components.file.FilePoller.processFileAndDelete(
> > FilePoller.java:197)
> > > org.servicemix.components.file.FilePoller$1.run(FilePoller.java
> > :182)
> > > org.apache.geronimo.connector.work.WorkerContext.run(
> > WorkerContext.java:291)
> > > EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> > Source)
> > > java.lang.Thread.run(Thread.java:595)
> > >java.lang.UnsupportedOperationException: Method not yet implemented
> > >Method not yet implemented
> > >javax.mail.internet.MimeBodyPart.setFileName(MimeBodyPart.java:167)
> > >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:432)
> > >org.apache.commons.mail.MultiPartEmail.attach(MultiPartEmail.java:292)
> > >com.mycomp.esb.Emailer.sendMailwithAttachments(Emailer.java:315)
> > >com.mycomp.esb.Emailer.process(Emailer.java:236)
> > >org.servicemix.components.util.OutBinding.onMessageExchange(
> > OutBinding.java:51)
> > >org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > DeliveryChannelImpl.java:590)
> > >org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:182)
> > >org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > >org.servicemix.jbi.nmr.flow.AbstractFlow.send(AbstractFlow.java:124)
> > >org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java:289)
> > >org.servicemix.jbi.container.JBIContainer.sendExchange(JBIContainer.java
> > :590)
> > >org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > DeliveryChannelImpl.java:349)
> > >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:423)
> > >org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:400)
> > >org.servicemix.components.file.FilePoller.processFile(FilePoller.java
> > :220)
> > >org.servicemix.components.file.FilePoller.processFileAndDelete(
> > FilePoller.java:197)
> > >org.servicemix.components.file.FilePoller$1.run(FilePoller.java:182)
> > >org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java
> > :291)
> > >EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> > Source)
> > >java.lang.Thread.run(Thread.java:595)
> > >
> > >INFO - Emailer.sendMailwithAttachments(329) |
> > ===========================================================================================
> > >ERROR - PojoSupport.fail(254) | Error processing exchange
> > >java.lang.Exception: Problem occured while sending the email.Contactyour admin.
> > > at com.mycomp.esb.Emailer.process(Emailer.java:242)
> > > at org.servicemix.components.util.OutBinding.onMessageExchange(
> > OutBinding.java:51)
> > > at
> > org.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> > DeliveryChannelImpl.java:590)
> > > at org.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> > AbstractFlow.java:182)
> > > at org.servicemix.jbi.nmr.flow.st.STFlow.doSend(STFlow.java:45)
> > > at org.servicemix.jbi.nmr.flow.AbstractFlow.send(
> > AbstractFlow.java:124)
> > > at org.servicemix.jbi.nmr.Broker.sendExchangePacket(Broker.java
> > :289)
> > > at org.servicemix.jbi.container.JBIContainer.sendExchange(
> > JBIContainer.java:590)
> > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.doSend(
> > DeliveryChannelImpl.java:349)
> > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:423)
> > > at org.servicemix.jbi.messaging.DeliveryChannelImpl.sendSync(
> > DeliveryChannelImpl.java:400)
> > > at org.servicemix.components.file.FilePoller.processFile(
> > FilePoller.java:220)
> > > at org.servicemix.components.file.FilePoller.processFileAndDelete
> > (FilePoller.java:197)
> > > at org.servicemix.components.file.FilePoller$1.run(
> > FilePoller.java:182)
> > > at org.apache.geronimo.connector.work.WorkerContext.run(
> > WorkerContext.java:291)
> > > at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
> > Source)
> > > at java.lang.Thread.run(Thread.java:595)
> > >DEBUG - AbstractFlow.send(117) | Called Flow send
> > >DEBUG - AbstractFlow.doRouting(175) | Called Flow doRouting
> > >
> > >
> > >
> > >
> > >
> > ><=====================================LOG OF STACK TRACE WHEN RAN WITH
> > ServiceMix-3.0-SNAPSHOT========================>
> > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > >DEBUG - FilePoller.pollFile(165) | Scheduling file inbox\email01.xml for
> > processing
> > >DEBUG - FilePoller.processFileAndDelete(181) | Processing file
> > inbox\email01.xml
> > >DEBUG - Broker.resolveAddress(388) | Routing exchange
> > org.apache.servicemix.jbi.messaging.InOnlyImpl@19ecd80 to:
> > ServiceEndpoint[service={http://mycomp.com/test/}emailer,endpoint=emailer]
> > >DEBUG - AbstractFlow.send(116) | Called Flow send
> > >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> > >INFO - Emailer.process(235) | [mailhost,to,from,cc,bcc,sub,body,att] - [
> > mail.mycomp.com,pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com,
> > mailComponent@mycomp.com,pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com,pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com,This is test mail ., This is the body content
> > of the test mail .,C:/tmp/test/o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> > >INFO - Emailer.sendMailwithAttachments(254) | ====================Log
> > Messsages Email with Attachments ============================
> > >INFO - Emailer.sendMailwithAttachments(256) |
> > [mailhost,to,from,cc,bcc,sub,body,att] - [mail.mycomp.com<--->
> > pavan.ramadugula@mycomp.com,uday.garikapati@mycomp.com<--->
> > mailComponent@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com<--->pavan.ramadugula@mycomp.com,
> > uday.garikapati@mycomp.com<--->This is test mail .<---> This is the body
> > content of the test mail .<--->C:/tmp/test/
> > >o2791450.pdf|C:/tmp/test/o2791453.pdf ]
> > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > o2791450.pdf
> > >INFO - Emailer.sendMailwithAttachments(272) | Attachment name ->
> > o2791453.pdf
> > >INFO - Emailer.sendMailwithAttachments(280) | Message part for email
> > created.
> > >INFO - Emailer.sendMailwithAttachments(287) | 'To-list' for Email has
> > been set.
> > >INFO - Emailer.sendMailwithAttachments(290) | 'From' for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(297) | cc list for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(304) | bcc list for email has
> > been set.
> > >INFO - Emailer.sendMailwithAttachments(307) | subject for email has been
> > set.
> > >INFO - Emailer.sendMailwithAttachments(309) | message-body for email has
> > been set.
> > >1 name = META-INF/mime.types
> > > attachement added to mail.
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > >INFO - Emailer.sendMailwithAttachments(321) | email has been sent
> > successfully.
> > >INFO - Emailer.sendMailwithAttachments(329) |
> > ===========================================================================================
> > >DEBUG - AbstractFlow.send(116) | Called Flow send
> > >DEBUG - AbstractFlow.doRouting(165) | Called Flow doRouting
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\install for new or modified archives
> > >DEBUG - AutoDeploymentService.monitorDirectory(483) | Monitoring
> > directory C:\Installations\JavaEE\AppServers\ServiceMix\servicemix-
> > 3.0-SNAPSHOT\ATeOP\rootDir\deploy for new or modified archives
> > >DEBUG - FilePoller.pollFileOrDirectory(151) | Polling directory inbox
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > ><=========================================== JUNK CONTENT RECIVED WHEN
> > USED ServiceMix-3.0-SNAPSHOT===================================================>
> > >
> > >------=_Part_0.1144073440659
> > >
> > > This is the body content of the test mail .
> > >------=_Part_0.1144073440659
> > >content-disposition:attachment; filename=o2791450.pdf
> > >content-description:mail attachment
> > >
> > >%PDF-1.4
> > >%âãÏÓ
> > >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> > >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> > ÂÝ‚.üçPpUæÉ
> > nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> > >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> > (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> > &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> > ><Ý߯0éüÕoåá
> > >endstream
> > >endobj
> > >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet [/PDF
> > /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612 792]>>
> > >endobj
> > >1 0
> > obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> > >endobj
> > >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> > >endobj
> > >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> > >endobj
> > >6 0 obj<</CreationDate(D:20060317215521+05'30')/Producer(iText1.1 by
> > lowagie.com \(based on
> > itext-paulo-142\))/ModDate(D:20060317215521+05'30')>>
> > >endobj
> > >xref
> > >0 7
> > >0000000000 65535 f
> > >0000000880 00000 n
> > >0000000015 00000 n
> > >0000000965 00000 n
> > >0000000724 00000 n
> > >0000001015 00000 n
> > >0000001059 00000 n
> > >trailer
> > ><</ID
> > [<c0442af2fe3f7656f46bba0efb7d408a><c0442af2fe3f7656f46bba0efb7d408a>]/Root
> > 5 0 R/Size 7/Info 6 0 R>>
> > >startxref
> > >1212
> > >%%EOF
> > >
> > >------=_Part_0.1144073440659
> > >content-disposition:attachment; filename="o2791453.pdf "
> > >content-description:mail attachment
> > >
> > >%PDF-1.4
> > >%âãÏÓ
> > >2 0 obj <</Filter/FlateDecode/Length 642>>stream
> > >xœ¥VÛrÚ0}ç+ö'´J«‹í¼Ñ†:Ãebg:™É‹‹àâØŒlÒË×W@n(ÛvâŠÐZÚ³{ttƒdÑáŒAò«ó1ép`îÃ#:‚ä(r)óáÂÍÜãe§{'|;Z
> > ÂÝ‚.üçPpUæÉ
> > nÒÆÔ~ÞSLé€'a'aéi`¶\æñv³)rS÷`\.NÛðªEpœYh¦àkj)ëû¼(|2ec,\ViÖ†WÔÇŸ1åCUÿË`ÚgøÉ5(c)%ẕÝÀM×Ä]
> > >™ëÞƒ`7'ûÖç1yô3›ßæ¯DH"áAç[CëÈ}á=˜ØSHŒµ?(c)57]äÚ•…¡èKƘÃI?QŒô=ûÉ
> > (`cêkHËÒ»j[65T%4«Ü}ÛÌ(c)*µÌ5uí´—pW1dUQ¤ÖÏŸÿ±]˜_Î&ãxx~ö0W§ÎC‡ébõ¸†$5Ô
> > &(c)AEºJ²Kd—ÈÉ.'']òˆì'‡d—< »äºý
> > ><Ý߯0éüÕoåá
> > >endstream
> > >endobj
> > >4 0 obj<</Type/Page/Contents 2 0 R/Parent 3 0 R/Resources<</ProcSet [/PDF
> > /Text /ImageB /ImageC /ImageI]/Font<</F1 1 0 R>>>>/MediaBox[0 0 612 792]>>
> > >endobj
> > >1 0
> > obj<</Type/Font/BaseFont/Courier/Subtype/Type1/Encoding/WinAnsiEncoding>>
> > >endobj
> > >3 0 obj<</Count 1/Type/Pages/Kids[4 0 R]>>
> > >endobj
> > >5 0 obj<</Type/Catalog/Pages 3 0 R>>
> > >endobj
> > >6 0 obj<</CreationDate(D:20060317221145+05'30')/Producer(iText1.1 by
> > lowagie.com \(based on
> > itext-paulo-142\))/ModDate(D:20060317221145+05'30')>>
> > >endobj
> > >xref
> > >0 7
> > >0000000000 65535 f
> > >0000000880 00000 n
> > >0000000015 00000 n
> > >0000000965 00000 n
> > >0000000724 00000 n
> > >0000001015 00000 n
> > >0000001059 00000 n
> > >trailer
> > ><</ID
> > [<e37d8ca05c4626b86470e062e25ba884><e37d8ca05c4626b86470e062e25ba884>]/Root
> > 5 0 R/Size 7/Info 6 0 R>>
> > >startxref
> > >1212
> > >%%EOF
> > >
> > >------=_Part_0.1144073440659--
> > >
> > >
> > >
> > >
> >
>