Charles, I called bean the way you suggested me but I can't add attribute name class inside <camelContext>. Following is my xml.
<bean id="headerBean" class="com.ntuclite2.fromswift.ProcessHeader" /> <camelContext xmlns="http://camel.apache.org/schema/spring"> <bean ref="headerBean" method="setHeaderIfNotNull" /> </camelContext> but once I run it, I got following error inside log: *Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.swift.iplasa.flows.NTUCLite2Adapter-FromSWIFT-Exchange, config=osgibundle:/META-INF/spring/*.xml)) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'headerBean' defined in URL* When I added class attribute for bean inside camelContext tag. I got this error >>>>>> *Attribute 'class' is not allowed to appear in element 'bean'.* Actually, the file might not have header, so I also want to setHeader when header for that file is null. Thank you very much for helping me out. I am newbie to this apache camel and spring DSL. I am reading Camel in Action book but it's more applicable to java xml. I wonder if you have any other resource which I can refer to deal with apache camel in spring DSL. Thanks, Claire -- View this message in context: http://camel.465427.n5.nabble.com/Using-org-apache-camel-Exchange-tp5743878p5744058.html Sent from the Camel Development mailing list archive at Nabble.com.