You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Hubertus.Willuhn" <hu...@dinsoftware.de> on 2015/12/08 10:12:33 UTC

Camel/Spring - JavaConfig dont load CamelContext

Hi All,

i have a problem with Camel in conjunction with Spring and Java
configuration.

All my routes getting picked up by Component Scanning but in the error log
came up a Error:

o.apache.camel.impl.DefaultCamelBeanPostProcessor -- No CamelContext defined
yet so cannot inject into bean:
org.apache.camel.component.file.FileComponent

Im starting my app through gradle. It starts correctly my main class
annotated with @Configuration and
@Import.

My Java Config looks like this:

@Configuration
@EnableAutoConfiguration
@ComponentScan ({"com.app.service",
				 "com.app.camel",
				 "com.app.modules",
				 "com.app.repository"})
public class CamelConfig extends CamelConfiguration
{}

My Route looks like this:

@Component
@Profile ({"app", "srv"})
public class SRV_Preparator extends Preparator
{
	@Override
	public Endpoint producer()
	{
		return endpoint("file:" + this.baseDir +
"?noop=true&fileName=SRV_NSB.XML");
	}
...

Preparator defined like

public abstract class Preparator extends RouteBuilder {
...
}

Route Definition in Preparator class like:

from(producer()).split().xtokenize(splitPath(), extractionMode(),
namespaces()).streaming()...

The log output shows that all routes in the package get loaded and started
but the CamelContext seems to be missing? After start up the route doen't do
anything.

What is the problem? Can somebody give me a hint?

Great Thx in advanced!



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Spring-JavaConfig-dont-load-CamelContext-tp5774816.html
Sent from the Camel - Users mailing list archive at Nabble.com.