camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: CSV Reporting with Java and XML
Date Fri, 20 Aug 2010 09:23:12 GMT
somemightsay wrote:
> The CamelContext.xml is created. It is used when you run Main.class, but
> obviously not when I run the Java.class i have created to define the routes.
> 
> 
> So when you run Main.class, CamelContext.xml and Camelroutes.java are both
> used, and it works correctly.
> 
> But I can't seem to get Main.class to be used when running the jar. I have
> tried adding it to the manifest but with no success.

What kind of error did you get?

> 
> Unless I can get that working the other option is to not use the Main.class
> and instead just use camelcontext and camelroutes.
If you already have a CamelContext.xml, you can create a 
ClassPathApplicationContext yourself, and spring will create a camel 
context and start it for you.
> 
> This would mean having to find a way for the Camelroutes.java to reference
> the XML file, because at present it does not see it, so does not use the
> endpoints/db login data.

Your CamelRoutes.java don't need to know the Spring configure, if you 
have some properties file need to be loaded, you can take a look at 
camel-properties component[1]

[1]http://camel.apache.org/properties.html

Willem


Mime
View raw message