You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by kermitt <he...@genesys.com> on 2007/03/14 09:47:59 UTC

flat file writer

Hi,

I have an XML request and I need to call a third part tool that needs a flat
file as argument. I used EIP pattern and then use the XSL engine to generate
my flat file. But as soon as the file is generated I got an exception saying
it's not a valid XML file. 

How can I do that ? 


-- 
View this message in context: http://www.nabble.com/flat-file-writer-tf3400848s12049.html#a9470428
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: [implentation on an internal system host] flat file writer

Posted by Guillaume Nodet <gn...@gmail.com>.
Yeah, this is not supported yet.
You should raise a jira for that, it should be easy
to add a property to generate an attachment instead of
the main xml content ...

On 3/14/07, kermitt <he...@genesys.com> wrote:
>
>
> Thx, my issue is I can't output from the XSL component something that is
> not
> XML, here is the trace log :
>
> [Fatal Error] :2:4: Content is not allowed in prolog.
> ERROR - FileComponent                  - Error processing exchange InOnly[
>   id: ID:MON-HBOURZEIX-1214-1173859213020-3:33
>   status: Active
>   role: provider
>   service: {http://www.genesys.com/jbi}pervasive
>   endpoint: writeParam
>   in: Unable to display: org.xml.sax.SAXParseException: Content is not
> allowed in prolog.
> ]
> javax.jbi.messaging.MessagingException: org.xml.sax.SAXParseException:
> Content is not allowed in prolog.
>         at
> org.apache.servicemix.expression.JAXPXPathExpression.evaluate(
> JAXPXPathExpression.java:114)
>         at
> org.apache.servicemix.components.util.DefaultFileMarshaler.getOutputName(
> DefaultFileMarshaler.java:65)
>         at
> org.apache.servicemix.file.FileSenderEndpoint.processInOnly(
> FileSenderEndpoint.java:68)
>         at
> org.apache.servicemix.common.endpoints.ProviderEndpoint.process(
> ProviderEndpoint.java:100)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(
> AsyncBaseLifeCycle.java:489)
>         at
> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(
> AsyncBaseLifeCycle.java:441)
>         at
> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(
> BaseLifeCycle.java:46)
>         at
> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(
> DeliveryChannelImpl.java:593)
>         at
> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(
> AbstractFlow.java:174)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java
> :176)
>         at
> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java
> :134)
>         at
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask
> (ThreadPoolExecutor.java:665)
>         at
>
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run
> (ThreadPoolExecutor.java:690)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: org.xml.sax.SAXParseException: Content is not allowed in
> prolog.
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
> Source)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(
> SourceTransformer.java:224)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(
> SourceTransformer.java:135)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(
> SourceTransformer.java:289)
>         at
> org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(
> SourceTransformer.java:306)
>         at
> org.apache.servicemix.expression.JAXPXPathExpression.getXMLNode(
> JAXPXPathExpression.java:179)
>         at
> org.apache.servicemix.expression.JAXPXPathExpression.evaluate(
> JAXPXPathExpression.java:94)
>         ... 13 more
> [Fatal Error] :2:4: Content is not allowed in prolog.
> [Fatal Error] :2:4: Content is not allowed in prolog.
>
> johper wrote:
> >
> > Maybe if you switch from default file marshaler to binary ?
> >   <file:sender service="postman:fileWriter" endpoint="endpoint">
> >                       <property name="directory" value="archive/outbox"
> />
> >               <property name="marshaler">
> >                       <bean
> > class="org.apache.servicemix.components.util.BinaryFileMarshaler">
> >                       </bean>
> >               </property>
> >   </file:sender>
> > ========================
> >
> > kermitt wrote:
> >>
> >> Hi,
> >>
> >> I have an XML request and I need to call a third part tool that needs a
> >> flat file as argument. I used EIP pattern and then use the XSL engine
> to
> >> generate my flat file. But as soon as the file is generated I got an
> >> exception saying it's not a valid XML file.
> >>
> >> How can I do that ?
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/flat-file-writer-tf3400848s12049.html#a9471079
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: [implentation on an internal system host] flat file writer

Posted by kermitt <he...@genesys.com>.
Thx, my issue is I can't output from the XSL component something that is not
XML, here is the trace log :

[Fatal Error] :2:4: Content is not allowed in prolog.
ERROR - FileComponent                  - Error processing exchange InOnly[
  id: ID:MON-HBOURZEIX-1214-1173859213020-3:33
  status: Active
  role: provider
  service: {http://www.genesys.com/jbi}pervasive
  endpoint: writeParam
  in: Unable to display: org.xml.sax.SAXParseException: Content is not
allowed in prolog.
]
javax.jbi.messaging.MessagingException: org.xml.sax.SAXParseException:
Content is not allowed in prolog.
        at
org.apache.servicemix.expression.JAXPXPathExpression.evaluate(JAXPXPathExpression.java:114)
        at
org.apache.servicemix.components.util.DefaultFileMarshaler.getOutputName(DefaultFileMarshaler.java:65)
        at
org.apache.servicemix.file.FileSenderEndpoint.processInOnly(FileSenderEndpoint.java:68)
        at
org.apache.servicemix.common.endpoints.ProviderEndpoint.process(ProviderEndpoint.java:100)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:489)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:441)
        at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:593)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:174)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:176)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSourceFromStream(SourceTransformer.java:224)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMSource(SourceTransformer.java:135)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:289)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toDOMNode(SourceTransformer.java:306)
        at
org.apache.servicemix.expression.JAXPXPathExpression.getXMLNode(JAXPXPathExpression.java:179)
        at
org.apache.servicemix.expression.JAXPXPathExpression.evaluate(JAXPXPathExpression.java:94)
        ... 13 more
[Fatal Error] :2:4: Content is not allowed in prolog.
[Fatal Error] :2:4: Content is not allowed in prolog.

johper wrote:
> 
> Maybe if you switch from default file marshaler to binary ?
>   <file:sender service="postman:fileWriter" endpoint="endpoint">
>                	<property name="directory" value="archive/outbox" />
> 	       	<property name="marshaler">
> 	       		<bean
> class="org.apache.servicemix.components.util.BinaryFileMarshaler">
> 	       		</bean>
> 		</property>
>   </file:sender>
> ========================
> 
> kermitt wrote:
>> 
>> Hi,
>> 
>> I have an XML request and I need to call a third part tool that needs a
>> flat file as argument. I used EIP pattern and then use the XSL engine to
>> generate my flat file. But as soon as the file is generated I got an
>> exception saying it's not a valid XML file. 
>> 
>> How can I do that ? 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/flat-file-writer-tf3400848s12049.html#a9471079
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: [implentation on an internal system host] flat file writer

Posted by johper <ka...@hotmail.com>.
Maybe if you switch from default file marshaler to binary ?
  <file:sender service="postman:fileWriter" endpoint="endpoint">
               	<property name="directory" value="archive/outbox" />
	       	<property name="marshaler">
	       		<bean
class="org.apache.servicemix.components.util.BinaryFileMarshaler">
	       		</bean>
		</property>
  </file:sender>
========================

kermitt wrote:
> 
> Hi,
> 
> I have an XML request and I need to call a third part tool that needs a
> flat file as argument. I used EIP pattern and then use the XSL engine to
> generate my flat file. But as soon as the file is generated I got an
> exception saying it's not a valid XML file. 
> 
> How can I do that ? 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/flat-file-writer-tf3400848s12049.html#a9470584
Sent from the ServiceMix - User mailing list archive at Nabble.com.