Did you had a look at [1] and [2]?
There is no need to do it so complicated by converting the XML into a JAXB
object...
You only need something like this:
public class InventoryMain {
public static void main(String[] args) throws Exception {
Main main = new Main();
main.setApplicationContextUri("META-INF/spring/camel-context.xml");
main.enableHangupSupport();
main.start();
}
}
Source borrowed by Claus/Jonathan book - Camel in Action
[1]
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html
[2] http://camel.apache.org/running-camel-standalone.html
Best,
Christian
On Tue, Feb 14, 2012 at 9:16 PM, kapoor <[email protected]> wrote:
> hi I am new user to camel.
>
> I have tried an example by loading router from xml file. I have done it
> successfully. My code is here.
>
>
> JAXBContext jaxb =
> JAXBContext.newInstance(Constants.JAXB_CONTEXT_PACKAGES);
> Unmarshaller unmarshaller = jaxb.createUnmarshaller();
>
> Resource rs = new ClassPathResource("cameltest.xml");
> Object value = unmarshaller.unmarshal(rs.getInputStream());
> RoutesDefinition routes = (RoutesDefinition) value;
>
> context.addRouteDefinitions(routes.getRoutes());
>
> Instead of doing unmarshalling it in java file. I need to pass the jaxb
> object to the xml and should done the routing using unmarshalling inside
> xml
> file itself.
>
> help me....
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/routing-inside-xml-file-tp5483745p5483745.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>