Hi Bruno, I somtime encountered the error Content not allowed in prolog. This always happened when the xml parser read a file that contained no valid xml. So it seems to me you have a file output.txt somewhere that is read and contains no valid xml.
You could try to put a bean after from that simply receives an Exchange in a method. So you can debug into this and see where the file comes from. Greetings Christian Christian Schneider Informationsverarbeitung Business Solutions Handel und Dispatching Tel : +49-(0)721-63-15482 EnBW Systeme Infrastruktur Support GmbH Sitz der Gesellschaft: Karlsruhe Handelsregister: Amtsgericht Mannheim HRB 108550 Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck Geschäftsführer: Jochen Adenau, Hans-Günther Meier -----Ursprüngliche Nachricht----- Von: Bruno Dusausoy [mailto:[email protected]] Gesendet: Dienstag, 6. Juli 2010 14:02 An: Camel Users ML Betreff: File component behavior Hi, I'm new to both Camel and EIP so maybe my question/problem is dumb ;). I have a route defined in Spring as this : <!-- ActiveMQ beans and usual stuff --> <bean id="uploadBean" class="be.ucm.career.quarterly.upload.UploadBean"/> <camel:camelContext xmlns="http://camel.apache.org/schema/spring"> <camel:package>foo.bar</camel:package> <camel:route> <camel:from uri="file:src/data?noop=true&delay=30000" /> <camel:bean ref="uploadBean"/> <camel:to uri="jms:output" /> </camel:route> </camel:camelContext> The implementation of "uploadBean" : public class UploadBean { @Handler public String upload(@XPath("configuration/loopCount/text()")String chunkSize) { System.out.println("Chunk size is : " + chunkSize); return "FOO_123"; } } When launching the project with "mvn camel:run", I get this : [...] // INFO output [...] Chunk size is : 100 [src/data?delay=30000&noop=true] BrokerService INFO Using Persistence Adapter: AMQPersistenceAdapter(activemq-data\localhost) [src/data?delay=30000&noop=true] AMQPersistenceAdapter INFO AMQStore starting using directory: activemq-data\localhost [src/data?delay=30000&noop=true] KahaStore INFO Kaha Store using data directory activemq-data\localhost\kr-store\state [src/data?delay=30000&noop=true] AMQPersistenceAdapter INFO Active data files: [1] [src/data?delay=30000&noop=true] BrokerService INFO ActiveMQ 5.2.0 JMS Message Broker (localhost) is starting [src/data?delay=30000&noop=true] BrokerService INFO For help or more information please see: http://activemq.apache.org/ [ JMX connector] ManagementContext INFO JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi [src/data?delay=30000&noop=true] KahaStore INFO Kaha Store using data directory activemq-data\localhost\kr-store\data [src/data?delay=30000&noop=true] BrokerService INFO ActiveMQ JMS Message Broker (localhost, ID:100WCTI150-2821-1278413932666-0:0) started [src/data?delay=30000&noop=true] TransportConnector INFO Connector vm://localhost Started [src/data?delay=30000&noop=true] TransportConnector INFO Connector vm://localhost Stopped [src/data?delay=30000&noop=true] BrokerService INFO ActiveMQ Message Broker (localhost, ID:100WCTI150-2821-1278413932666-0:0) is shutting down [src/data?delay=30000&noop=true] BrokerService INFO ActiveMQ JMS Message Broker (localhost, ID:100WCTI150-2821-1278413932666-0:0) stopped [Fatal Error] output.txt:1:1: Content is not allowed in prolog. [Fatal Error] :1:1: Content is not allowed in prolog. [src/data?delay=30000&noop=true] DefaultErrorHandler ERROR Failed delivery for exchangeId: b109fe1a-964e-4c70-91b0-bba46fb77766. Exhausted after delivery attempt: 1 caught: org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: configuration/loopCount/text(). Reason: javax.xml.xpath.XPathExpressionException org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath: configuration/loopCount/text(). Reason: javax.xml.xpath.XPathExpressionException [...] // STACK TRACE [src/data?delay=30000&noop=true] GenericFileOnCompletion WARN Rollback file strategy: org.apache.camel.component.file.strategy.genericfilenoopprocessstrat...@b9237a for file: GenericFile[output.txt] I'm wondering why I get this message, since the XPath is correct : you can see the output of the method called on the bean at the beginning the aforementioned snippet. Moreover, I don't know where did the file component get this "output.txt" file... :-/ The input.xml file is quite simple : <?xml version="1.0"?> <configuration> <loopCount>100</loopCount> </configuration> Can someone tell me what I'm doing wrong ? Regards. -- Bruno Dusausoy YP5 Software -- Pensez environnement : limitez l'impression de ce mail. Please don't print this e-mail unless you really need to.
