camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elezabeth <>
Subject Camel and tomcat
Date Tue, 25 Sep 2012 12:55:01 GMT
Hi ,I am trying to make use of  camel in tomcat server. My requirement is to
read a cvs file in a folder whenever a *http request* is hit. I was able to
do this successfully using camel when I was using the "Run as a Java
application" in y IDE.Now I have to do the same thing in "Run on server" and
I using tomcat server 7.0 .  But now nothing is working..  I am not able to
understand wat exactly is happening. I checked the camel servlet tomcat
example.But that couldn't help me..I am pasting my code
below./**/public class OagProcessor extends RouteBuilder {   
DataFormat bindy = new BindyCsvDataFormat(           
"");    Exchange exchnge = null;   
String fileName = null;    @Override    public void configure() throws
Exception {        System.out.println("in configure");       
}}*/*public class FileConsumer {		@Inject	private
ConsumerTemplate consumer;		@Inject	private ProducerTemplate producer;	
public void setConsumer(ConsumerTemplate consumer) {		this.consumer =
consumer;	}		public void setProducer(ProducerTemplate producer) {	
this.producer = producer;	}	public void consumeFile(Exchange exchange)
throws Exception {		System.out.println("File Name in Consumer ->
"+exchange.getIn().getHeaders());		String fileName =
(String)exchange.getIn().getHeader("filename");		Exchange recievedEx =
System.out.println("Recieved ->
"+recievedEx.getIn().getBody().getClass().getName());				InputStream
inputStream =
recievedEx);		System.out.println("InputStream >>> "+inputStream);			
exchange.getIn().setBody(inputStream);		//producer.sendBody("seda:myfile",
inputStream);	}}*/camel-context.xml/*															  								
*/web.xml/*s<?xml version="1.0" encoding="UTF-8"?>		
contextConfigLocation		/WEB-INF/conf/bootstrap.xml
/WEB-INF/spring/camel-context.xml	 				appServlet	
org.springframework.web.servlet.DispatcherServlet					contextConfigLocation					
/WEB-INF/conf/bootstrap.xml							1				mySerlvet	
contextConfigLocation						/WEB-INF/spring/camel-context.xml								2			
myServlet		/				appServlet		/	 		DB Connection		jdbc/gavss	
javax.sql.DataSource		Container	 web.xml is the portion where I am not very
quite sure of. I started my server.. the only thing I get in the console log
is  File Name in Consumer -> null....Can anyone tell me what is wrong here?

View this message in context:
Sent from the Camel - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message