camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nettome <>
Subject Not able to define processor in Camel
Date Thu, 24 Jul 2014 12:22:46 GMT
I'm new to Camel and learning it step by step.
I have a scenario where i have to process a task in a route. I'm creating a
XML file and loading the routes from it.
Below is my xml file -

<routes xmlns="">
<bean id= "jsonProcessor" class="com.validator.parser.JsonParser" />
    <route id="fromFile">
        <from uri="file:/data/inbox"/>
        <process ref="jsonProcessor" />        
        <to uri="cache:default"/>

Code to load the XML file - 

ModelCamelContext context = (ModelCamelContext) new DefaultCamelContext();
		RouteBuilder builder = null;
		File fileFolder = new
		// load route from XML and add them to the existing camel context		
		RoutesDefinition routes;
		try {
			for(final File file : fileFolder.listFiles()){
					InputStream in = new FileInputStream(file);
					routes = context.loadRoutesDefinition(in);
		} catch (Exception e) {

JsonParser is a Processor and I want the route to go to the processor. But
while I'm doing the above I'm getting the following error -

Caused by: java.lang.IllegalArgumentException: registry entry called
jsonProcessor must be specified on: process[ref:jsonProcessor]

there are couple of things I'm missing/not clear over here - 

1. Is my bean definition correct?
2. Should I create the camelContext in the XML file or the Java code 
3. Is my XML structured properly.

Please guide. I'm stuck and not able to find much on the internet.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message