You need to do the XML as a regular spring xml file with <beans> and all that stuff.
See http://camel.apache.org/spring.html On Tue, Oct 11, 2016 at 9:43 PM, sridharb <sridharb...@gmail.com> wrote: > Hi, > > I tried to use *@ImportResource* but I get the error as below, > > org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line > 1 in XML document from class path resource [interceptors.xml] is invalid; > nested exception is org.xml.sax.SAXParseException; lineNumber: 1; > columnNumber: 61; cvc-elt.1: Cannot find the declaration of element > 'camelContext'. > at > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399) > ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] > at > org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) > ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE] > > > My *interceptors.xml* has the below content, > > <camelContext xmlns="http://camel.apache.org/schema/spring"> > > <interceptFrom> > <log message="Inside Interceptor" /> > </interceptFrom> > > > </camelContext> > > I used *@importResource* as below in my Spring Boot application class > , > @SpringBootApplication > @ImportResource("interceptors.xml") > public class CompositeApplication { > } > > Can you please help me on this. > > Thanks, > Sridhar > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Load-interceptors-in-XML-file-in-camel-application-based-on-spring-boot-tp5788568p5788630.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2