Same problem with JMS Component
ERROR - JmsComponent - Error processing exchange InOnly[
id: ID:w10210-4531-1162289739959-19:1
status: Active
role: provider
service: {http://servicemix.org/cheese}Input Senderdefault
endpoint: Input Senderdefault
in: <?xml version="1.0" encoding="UTF-8"?><content>
<dummy>Dummy Content for JBI Message</dummy>
</content>
]
javax.mail.internet.ParseException
at javax.mail.internet.ContentType.<init>(ContentType.java:83)
at
javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1249
)
at
javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1001
this is a JBI message with dummy XML content and binaryattachment.
mart wrote:
>
> Please have a look at this
>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5039094
>
> Regards,
>
> Martin
>
>
> mart wrote:
>>
>> I added
>> File toto=new File("test.xml");
>> message.setContent(new StreamSource(new FileInputStream(toto)));
>>
>> in my readMessage method of my customBinaryMarshaler. I can see the
>> message but I have still the same error.
>>
>>
>>
>> mart wrote:
>>>
>>> Maybe it is important that somewhere somewhat does a message.setContent
>>> . Even if the Mail marshaler is supposed to add a text, it receives a
>>> null content with attachment, this may be the problem.
>>>
>>> I will investigate and let you know
>>>
>>> gnodet wrote:
>>>>
>>>> If you use a text expression, there is no need to have an input
>>>> xml message. You should try to setup an debug environment
>>>> to see what really happens.
>>>>
>>>> On 10/20/06, mart <[EMAIL PROTECTED]> wrote:
>>>>>
>>>>> I am not sure if it is what I've done but I have already forced the
>>>>> text
>>>>> content as a property of the mail marshaler.
>>>>>
>>>>> <property name="text">
>>>>> <bean class="org.apache.servicemix.expression.ConstantExpression">
>>>>> <constructor-arg value="ServiceMix Message" />
>>>>> </bean>
>>>>> </property>
>>>>>
>>>>> If I do not do that with binary attachment, a NullPointerException is
>>>>> thrown. But still the message appears as "null".
>>>>>
>>>>> I have extended the Mail Marshaler to output information of the
>>>>> mimeMessage
>>>>> (mimeMessage.get*) but it is not relevant.
>>>>>
>>>>> How can I add dummy XML content in my custom binary marshaler? I have
>>>>> quite
>>>>> understood how to add a property but I don't know about XML content.
>>>>>
>>>>>
>>>>>
>>>>> gnodet wrote:
>>>>> >
>>>>> > The BinaryFileMarshaler does not create any xml content, it
>>>>> > just put the file as an attachment. It may cause problems
>>>>> > with the email component. You can create your own
>>>>> > marshaler and create a dummy xml content, or configure
>>>>> > the mail marshaler to use a property for the text content.
>>>>> >
>>>>> > If you plan to enhance the Marhsaler to create a dummy content
>>>>> > it would be nice to raise a JIRA and attach the modified
>>>>> > code (with an optional boolean flag on the marshaler to use it,
>>>>> > maybe) ...
>>>>> >
>>>>> > On 10/20/06, mart <[EMAIL PROTECTED]> wrote:
>>>>> >>
>>>>> >> FilePoller is ok I used it with DefaultFileMarshaler, an XML File
>>>>> >> transfer
>>>>> >> and it is ok.
>>>>> >> The problem appears when using BinaryFileMarshaler (with binary
>>>>> file).
>>>>> >> Why
>>>>> >> does the in message appears as "null" ?
>>>>> >> ( in: null )
>>>>> >>
>>>>> >> thanks
>>>>> >> regards,
>>>>> >>
>>>>> >> martin
>>>>> >>
>>>>> >> gnodet wrote:
>>>>> >> >
>>>>> >> > I used the junit tests available at
>>>>> >> >
>>>>> >>
>>>>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/test/java/org/apache/servicemix/components/email/MimeMailTest.java?revision=426415
>>>>> >> > and
>>>>> >> >
>>>>> >>
>>>>> http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/email/mimeMail.xml?view=markup
>>>>> >> >
>>>>> >> > with a small configuration change to use my gmail account and
>>>>> attach a
>>>>> >> > pdf from my hard disk. The main difference i was not using the
>>>>> >> > FilePoller, not sure if it is related.
>>>>> >> >
>>>>> >> > On 10/20/06, mart <[EMAIL PROTECTED]> wrote:
>>>>> >> >>
>>>>> >> >> The source file is corrupted :(
>>>>> >> >>
>>>>> >> >> gnodet wrote:
>>>>> >> >> >
>>>>> >> >> > The sources of the javamail implementation are available at
>>>>> >> >> >
>>>>> >>
>>>>> http://repo.mergere.com/maven2/javax/mail/mail/1.4/mail-1.4-sources.jar
>>>>> >> >> >
>>>>> >> >> > You may want to see at
>>>>> >> >> > javax.mail.internet.ContentType.<init>(ContentType.java:83)
>>>>> >> >> > what could produce the error.
>>>>> >> >> >
>>>>> >> >> > On 10/20/06, mart <[EMAIL PROTECTED]> wrote:
>>>>> >> >> >>
>>>>> >> >> >> Ok you may help me :) thanks
>>>>> >> >> >>
>>>>> >> >> >> I use James mail server, and Sun standard mail lib. It works
>>>>> when
>>>>> >> not
>>>>> >> >> >> using
>>>>> >> >> >> the BinaryFileMarshaler (and transfering text file).
>>>>> >> >> >>
>>>>> >> >> >> First here is my mail configuration: I had to add the text
>>>>> property
>>>>> >> to
>>>>> >> >> >> avoid
>>>>> >> >> >> a NullPointerException on this element.
>>>>> >> >> >>
>>>>> >> >> >> <!-- ####################### MailServer
>>>>> >> >> >> ########################
>>>>> >> >> >> -->
>>>>> >> >> >> <sm:activationSpec componentName="MailServer"
>>>>> >> >> >> service="foo:MailServer">
>>>>> >> >> >> <sm:component>
>>>>> >> >> >> <bean
>>>>> >> >> >>
>>>>> class="org.apache.servicemix.components.email.MimeMailSender">
>>>>> >> >> >> <property name="marshaler">
>>>>> >> >> >> <bean
>>>>> >> >> >>
>>>>> class="org.apache.servicemix.components.email.MimeMailMarshaler">
>>>>> >> >> >> <property name="from">
>>>>> >> >> >> <bean
>>>>> >> >> >> class="org.apache.servicemix.expression.ConstantExpression">
>>>>> >> >> >> <constructor-arg
>>>>> >> value="[EMAIL PROTECTED]"
>>>>> >> >> />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> <property name="to">
>>>>> >> >> >> <bean
>>>>> >> >> >> class="org.apache.servicemix.expression.ConstantExpression">
>>>>> >> >> >> <constructor-arg
>>>>> >> value="[EMAIL PROTECTED]"
>>>>> >> >> />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> <property
>>>>> name="subject">
>>>>> >> >> >> <bean
>>>>> >> >> >> class="org.apache.servicemix.expression.ConstantExpression">
>>>>> >> >> >> <constructor-arg
>>>>> value="ServiceMix
>>>>> >> >> Message"
>>>>> >> >> >> />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >>
>>>>> >> >> >> <property name="text">
>>>>> >> >> >> <bean
>>>>> >> >> >> class="org.apache.servicemix.expression.ConstantExpression">
>>>>> >> >> >> <constructor-arg
>>>>> value="ServiceMix
>>>>> >> >> Message"
>>>>> >> >> >> />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> <property name="sender">
>>>>> >> >> >> <bean
>>>>> >> >> >> class="org.springframework.mail.javamail.JavaMailSenderImpl">
>>>>> >> >> >> <property name="host"
>>>>> >> >> >> value="localhost" />
>>>>> >> >> >> <property name="port"
>>>>> >> >> value="25"
>>>>> >> >> >> />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> </bean>
>>>>> >> >> >> </sm:component>
>>>>> >> >> >> </sm:activationSpec>
>>>>> >> >> >>
>>>>> >> >> >>
>>>>> >> >> >> The binary comes from FTP (using VFS, the FTP BC seems
>>>>> buggy):
>>>>> >> >> >>
>>>>> >> >> >> <sm:activationSpec componentName="myFTPServerother"
>>>>> >> >> >> service="foo:myFTPServerother"
>>>>> >> >> >> destinationService="foo:MailServer">
>>>>> >> >> >> <sm:component>
>>>>> >> >> >> <bean
>>>>> >> class="org.apache.servicemix.components.vfs.FilePoller">
>>>>> >> >> >> <property name="workManager">
>>>>> >> >> >> <bean
>>>>> class="org.jencks.factory.WorkManagerFactoryBean">
>>>>> >> >> >> <property
>>>>> >> name="threadPoolSize"
>>>>> >> >> >> value="30" />
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> <property name="marshaler">
>>>>> >> >> >> <bean
>>>>> >> >> >>
>>>>> class="org.apache.servicemix.components.util.BinaryFileMarshaler" >
>>>>> >> >> >> </bean>
>>>>> >> >> >> </property>
>>>>> >> >> >> <property name="path"
>>>>> >> value="ftp://actes:[EMAIL PROTECTED]/"/>
>>>>> >> >> >> <property name="period" value="10000"/>
>>>>> >> >> >> </bean>
>>>>> >> >> >> </sm:component>
>>>>> >> >> >> </sm:activationSpec>
>>>>> >> >> >>
>>>>> >> >> >>
>>>>> >> >> >> And finally the full error, DEBUG Level:
>>>>> >> >> >>
>>>>> >> >> >> DEBUG - DeliveryChannelImpl - SendSync
>>>>> >> >> >> ID:w10210-4882-1161337803208-2
>>>>> >> >> >> 1:5 in DeliveryChannel{myFTPServerother}
>>>>> >> >> >> DEBUG - DeliveryChannelImpl - Sent: RobustInOnly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: consumer
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ]
>>>>> >> >> >> DEBUG - DefaultBroker - Routing exchange
>>>>> >> >> RobustInOnly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: provider
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> endpoint: MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ] to:
>>>>> >> >> >>
>>>>> >> >>
>>>>> >>
>>>>> ServiceEndpoint[service={http://servicemix.org/cheese}MailServer,endpoint=
>>>>> >> >> >> MailServer]
>>>>> >> >> >> DEBUG - DefaultBroker - Routing exchange
>>>>> >> >> RobustInOnly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: provider
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> endpoint: MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ] to:
>>>>> >> >> >>
>>>>> >> >>
>>>>> >>
>>>>> ServiceEndpoint[service={http://servicemix.org/cheese}MailServer,endpoint=
>>>>> >> >> >> MailServer]
>>>>> >> >> >> DEBUG - SedaFlow - Called Flow send
>>>>> >> >> >> DEBUG - SedaQueue -
>>>>> >> >> >> org.apache.servicemix.jbi.nmr.flow.seda
>>>>> >> >> >> [EMAIL PROTECTED] dequeued exchange: RobustInOnly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: provider
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> endpoint: MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ]
>>>>> >> >> >> DEBUG - DeliveryChannelImpl - Processing inbound
>>>>> >> exchange:
>>>>> >> >> >> RobustInOn
>>>>> >> >> >> ly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: provider
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> endpoint: MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ]
>>>>> >> >> >> DEBUG - DeliveryChannelImpl - Waiting for exchange
>>>>> >> >> >> ID:w10210-4882-116
>>>>> >> >> >> 1337803208-21:5 (10e284f) to be answered in
>>>>> >> >> >> DeliveryChannel{myFTPServerother} fr
>>>>> >> >> >> om sendSync
>>>>> >> >> >> DEBUG - DeliveryChannelImpl - Received:
>>>>> RobustInOnly[
>>>>> >> >> >> id: ID:w10210-4882-1161337803208-21:5
>>>>> >> >> >> status: Active
>>>>> >> >> >> role: provider
>>>>> >> >> >> service: {http://servicemix.org/cheese}MailServer
>>>>> >> >> >> endpoint: MailServer
>>>>> >> >> >> in: null
>>>>> >> >> >> ]
>>>>> >> >> >> DEBUG - OutBinding - Exchange failed
>>>>> >> >> >> org.springframework.mail.MailSendException: Could not send
>>>>> mails:
>>>>> >> null
>>>>> >> >> >> org.springframework.mail.MailSendException: Could not send
>>>>> mails:
>>>>> >> null
>>>>> >> >> >> javax.mail.internet.ParseException
>>>>> >> >> >> at
>>>>> >> javax.mail.internet.ContentType.<init>(ContentType.java:83)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1249
>>>>> >> >> >> )
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1001
>>>>> >> >> >> )
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:33
>>>>> >> >> >> 3)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1255
>>>>> >> >> >> )
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2012)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1980)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailS
>>>>> >> >> >> enderImpl.java:381)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen
>>>>> >> >> >> derImpl.java:326)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen
>>>>> >> >> >> derImpl.java:341)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSen
>>>>> >> >> >> derImpl.java:330)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.components.email.MimeMailSender.process(MimeMai
>>>>> >> >> >> lSender.java:73)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.components.util.OutBinding.onMessageExchange(Ou
>>>>> >> >> >> tBinding.java:49)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>>>> >> >> >> d(DeliveryChannelImpl.java:624)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>>>> >> >> >> w.java:169)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>>>> >> >> >> ava:177)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>>>> >> >> >> a:227)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> >>
>>>>> org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.ja
>>>>> >> >> >> va:291)
>>>>> >> >> >> at
>>>>> >> >> >>
>>>>> EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown
>>>>> >> So
>>>>> >> >> >> urce)
>>>>> >> >> >>
>>>>> >> >> >> Thank you!
>>>>> >> >> >>
>>>>> >> >> >>
>>>>> >> >> >> gnodet wrote:
>>>>> >> >> >> >
>>>>> >> >> >> > I have succesfully transfered binary attachments using
>>>>> mail.
>>>>> >> >> >> > Could you paste the full exception ?
>>>>> >> >> >> >
>>>>> >> >> >> > On 10/20/06, mart <[EMAIL PROTECTED]> wrote:
>>>>> >> >> >> >>
>>>>> >> >> >> >> Hello
>>>>> >> >> >> >>
>>>>> >> >> >> >> I wanted to know how well the mail component is supposed
>>>>> to
>>>>> >> handle
>>>>> >> >> JBI
>>>>> >> >> >> >> message that would have been created with the
>>>>> >> BinaryFileMarshaler?
>>>>> >> >> >> >>
>>>>> >> >> >> >> Looking at the code I see it is supposed to get the
>>>>> attachments
>>>>> >> of
>>>>> >> >> JBI
>>>>> >> >> >> >> mesage (binary) and put it as email attachment, but I have
>>>>> a
>>>>> >> >> "Cannot
>>>>> >> >> >> send
>>>>> >> >> >> >> Message: null" error in this situation.
>>>>> >> >> >> >>
>>>>> >> >> >> >> Thanks for any info
>>>>> >> >> >> >> --
>>>>> >> >> >> >> View this message in context:
>>>>> >> >> >> >>
>>>>> >> >> >>
>>>>> >> >>
>>>>> >>
>>>>> http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a6911556
>>>>> >> >> >> >> Sent from the ServiceMix - User mailing list archive at
>>>>> >> Nabble.com.
>>>>> >> >> >> >>
>>>>> >> >> >> >>
>>>>> >> >> >> >
>>>>> >> >> >> >
>>>>> >> >> >> > --
>>>>> >> >> >> > Cheers,
>>>>> >> >> >> > Guillaume Nodet
>>>>> >> >> >> >
>>>>> >> >> >> >
>>>>> >> >> >>
>>>>> >> >> >> --
>>>>> >> >> >> View this message in context:
>>>>> >> >> >>
>>>>> >> >>
>>>>> >>
>>>>> http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a6913324
>>>>> >> >> >> Sent from the ServiceMix - User mailing list archive at
>>>>> Nabble.com.
>>>>> >> >> >>
>>>>> >> >> >>
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >> > --
>>>>> >> >> > Cheers,
>>>>> >> >> > Guillaume Nodet
>>>>> >> >> >
>>>>> >> >> >
>>>>> >> >>
>>>>> >> >> --
>>>>> >> >> View this message in context:
>>>>> >> >>
>>>>> >>
>>>>> http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a6914695
>>>>> >> >> Sent from the ServiceMix - User mailing list archive at
>>>>> Nabble.com.
>>>>> >> >>
>>>>> >> >>
>>>>> >> >
>>>>> >> >
>>>>> >> > --
>>>>> >> > Cheers,
>>>>> >> > Guillaume Nodet
>>>>> >> >
>>>>> >> >
>>>>> >>
>>>>> >> --
>>>>> >> View this message in context:
>>>>> >>
>>>>> http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a6916629
>>>>> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>> >>
>>>>> >>
>>>>> >
>>>>> >
>>>>> > --
>>>>> > Cheers,
>>>>> > Guillaume Nodet
>>>>> >
>>>>> >
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a6918176
>>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>>
>>>>
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Mail-component-and-binary-tf2478268.html#a7091716
Sent from the ServiceMix - User mailing list archive at Nabble.com.