FTPPoller by default uses
org.apache.servicemix.components.util.DefaultFileMarshaler if it is not
declared in configuration and
As it is seen in the source code javax.xml.transform.Source.StreamSource
instance is created from the file content.
I mean, DefaultFileMarshaler supports only xml messages(files).

 public void readMessage(MessageExchange exchange, NormalizedMessage
message, InputStream in, String path) throws IOException, JBIException {
        message.setContent(new StreamSource(in, path));
        message.setProperty(FILE_NAME_PROPERTY, new
File(path).getName());
        message.setProperty(FILE_PATH_PROPERTY, path);
 }

In your case org.apache.servicemix.components.util.BinaryFileMarshaler
may be an option or you can write your own marshaller...
 file content is carried as an attachment if binary marshaller is used

  public void readMessage(MessageExchange exchange, NormalizedMessage
message, InputStream in, String path) throws IOException, JBIException {
        DataSource ds = new StreamDataSource(in, contentType);
        DataHandler handler = new DataHandler(ds);
        message.addAttachment(attachment, handler);
        message.setProperty(FILE_NAME_PROPERTY, new
File(path).getName());
        message.setProperty(FILE_PATH_PROPERTY, path);
    }



-----Original Message-----
From: praveen [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 12, 2006 2:03 PM
To: [email protected]
Subject: Problem in polling file from FTP Server...


Hi all,
        I tried to poll files from a directory in ftp server.while
polling all types of files such as txt,xml,jpeg etc., I m getting the
following exception.... Kindly look in to this and provide me the
solution.

javax.xml.transform.TransformerException: org.xml.sax.SAXParseException:
Document root element is missing.
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Unknown
Source)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toResult(SourceTransfor
mer.java:84)
        at
org.apache.servicemix.jbi.jaxp.SourceTransformer.toString(SourceTransfor
mer.java:104)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(D
eliveryChannelImpl.java:622)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.j
ava:168)
        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:2
26)
        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(Unknown Source)

Thanks in advance
Praveen D
--
View this message in context:
http://www.nabble.com/Problem-in-polling-file-from-FTP-Server...-tf24295
82.html#a6774118
Sent from the ServiceMix - User mailing list archive at Nabble.com.


This message and attachments are confidential and intended solely for the 
individual(s) stated in this
message. If you received this message although you are not the addressee, you 
are responsible to keep the
message confidential. The sender has no responsibility for the accuracy or 
correctness of the
information in the message and its attachments. Our company shall have no 
liability for any changes
or late receiving, loss of integrity and confidentiality, viruses and any 
damages caused in
anyway to your computer system.


Bu mesaj ve ekleri, mesajda gonderildigi belirtilen kisi/kisilere ozeldir ve 
gizlidir. Bu mesajin muhatabi
olmamaniza ragmen tarafiniza ulasmis olmasi halinde mesaj iceriginin gizliligi 
ve bu gizlilik yukumlulugune
uyulmasi zorunlulugu tarafiniz icin de soz konusudur. Mesaj ve eklerinde yer 
alan bilgilerin dogrulugu ve
guncelligi konusunda gonderenin ya da sirketimizin herhangi bir sorumlulugu 
bulunmamaktadir. Sirketimiz
mesajin ve bilgilerinin size degisiklige ugrayarak veya gec ulasmasindan, 
butunlugunun ve gizliliginin
korunamamasindan, virus icermesinden ve bilgisayar sisteminize verebilecegi 
herhangi bir zarardan
sorumlu tutulamaz.

Reply via email to