Hello,

I am trying to make a "binary file to JMS bridge" but, when I test it, I
receive a XMLStreamException.


My aim is to poll a directory (C:\Andre\Temp\00000006) for new files and
to send these files to a JMS queue.


There is a Service Assembly named Genesis2-File2JMS-SA containing two
Service Units:


- Genesis2-File2JMS-File-Consumer-SU:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:file="http://servicemix.apache.org/file/1.0";
        xmlns:genesis2="http://www.nrb.be/genesis2";>
        <file:poller service="genesis2:File2JMSService"
endpoint="poller"
                targetService="genesis2:File2JMSService"
file="C:\Andre\Temp\00000006"
                marshaler="#marshaler" />
        <bean id="marshaler"
        
class="org.apache.servicemix.components.util.BinaryFileMarshaler" />
</beans>


- Genesis2-File2JMS-JMS-Provider-SU:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
        xmlns:genesis2="http://www.nrb.be/genesis2";
        xmlns:amq="http://activemq.org/config/1.0";>
        <jms:endpoint service="genesis2:File2JMSService"
endpoint="endpoint"
                role="provider" destinationStyle="queue"
                jmsProviderDestinationName="queue/A"
                connectionFactory="#connectionFactory" />
        <amq:connectionFactory id="connectionFactory"
                brokerURL="tcp://localhost:61616" />
</beans>


Here is what happens when I put a file in C:\Andre\Temp\00000006:

INFO  - AutoDeploymentService          - Directory: deploy: Archive
changed: processing Genesis2-File2JMS-SA-1.0-SNAPSHOT.jar ...
INFO  - ServiceAssemblyLifeCycle       - Starting service assembly:
Genesis2-File2JMS-SA
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
Genesis2-File2JMS-File-Consumer-SU
INFO  - ServiceUnitLifeCycle           - Initializing service unit:
Genesis2-File2JMS-JMS-Provider-SU
INFO  - ServiceUnitLifeCycle           - Starting service unit:
Genesis2-File2JMS-File-Consumer-SU
INFO  - ServiceUnitLifeCycle           - Starting service unit:
Genesis2-File2JMS-JMS-Provider-SU
INFO  - AutoDeploymentService          - Directory: deploy: Finished
installation of archive:  Genesis2-File2JMS-SA-1.0-SNAPSHOT.jar
ERROR - JmsComponent                   - Error processing exchange
InOnly[
  id: ID:153.89.72.124-1127500dd03-2:1
  status: Active
  role: provider
  service: {http://www.nrb.be/genesis2}File2JMSService
  endpoint: endpoint
  in: null
]
javax.xml.stream.XMLStreamException: Trying to write END_DOCUMENT when
document has no root (ie. trying to output empty document).
                at
com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:
1396)
                at
com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.jav
a:1425)
                at
com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:15
86)
                at
com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:
508)
                at
org.apache.servicemix.soap.marshalers.SoapWriter.writeSimpleMessage(Soap
Writer.java:129)
                at
org.apache.servicemix.soap.marshalers.SoapWriter.writeMultipartMessage(S
oapWriter.java:140)
                at
org.apache.servicemix.soap.marshalers.SoapWriter.write(SoapWriter.java:8
9)
                at
org.apache.servicemix.jms.AbstractJmsProcessor.fromNMS(AbstractJmsProces
sor.java:149)
                at
org.apache.servicemix.jms.AbstractJmsProcessor.fromNMS(AbstractJmsProces
sor.java:143)
                at
org.apache.servicemix.jms.multiplexing.MultiplexingProviderProcessor.pro
cess(MultiplexingProviderProcessor.java:152)
                at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeC
ycle.java:538)
                at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBas
eLifeCycle.java:490)
                at
org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCyc
le.java:46)
                at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(D
eliveryChannelImpl.java:593)
                at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.j
ava:174)
                at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java
:171)
                at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:1
34)
                at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:885)
                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:907)
                at java.lang.Thread.run(Thread.java:619)


Could you please help me to solve this problem? Is there a bug, am I
misusing something...? As far as I know, servicemix-jms can receive, as
a consumer, plain (binary?) messages, so I think that it can also, as a
provider, send plain messages?


Thank you!


Andre Powroznik

Reply via email to