You need to use an OSGi aware CamelContext implementation.

If you use OSGi blueprint then use the one from camel-blueprint.
If you use Spring DM then use the one from camel-spring (there should
be some impl. in the JAR in some osgi package).


On Thu, May 5, 2011 at 6:15 PM, Craig Taylor <ctalk...@ctalkobt.net> wrote:
> I'm attempting to use a working OSGI Camel Context for normal processing and
> a DefaultCamelContext to validate syntax parsing of user-entered (manually
> and through wizard like interfaces).
>
> I'm using the noAutoStart on the routes to avoid picking up files and other
> possible ill-effects of testing the route.  When running the validation code
> isolated it works correctly.   When running it while the OSGI context is
> already defined the unit test complains about unknnown component types such
> as file, ftp and sftp.
>
> Snippit of test code follows:
> ---
>        try {
>            CamelContext context = new DefaultCamelContext();
>            RouteBuilder me = new endpointValidation();  // simple
> from(uri).to("log:test") routebuilder.
>            context.addRoutes( me );
>            context.start();
>            context.removeRouteDefinitions(
> me.getRouteCollection().getRoutes() );
>            context.stop();
>        }
>        catch( CamelException refEx )
>        {
> ---
>
> Is this the correct approach to take to validate camel uri's at run-time?
> If so, am I correct in feeling there's a risk adding test routes to a
> running camel context?
>
> --
> -------------------------------------------
> Craig Taylor
> ctalk...@ctalkobt.net
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to