Oh, you are using Blueprint. Current Blueprint doesn't support to import the resource like the Spring does. You may need to consider export the camel-conetxt as a service and import this service in another blueprint.
-- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Monday, September 2, 2013 at 2:15 PM, dantam74 wrote: > Importing the resource sounds like a good idea :-) I tried it but > unfortunately I get the following error: > > Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid > content was found starting with element 'import'. One of > '{"http://www.osgi.org/xmlns/blueprint/v1.0.0":description, > "http://www.osgi.org/xmlns/blueprint/v1.0.0":type-converters, > "http://www.osgi.org/xmlns/blueprint/v1.0.0":service, > "http://www.osgi.org/xmlns/blueprint/v1.0.0":reference-list, > "http://www.osgi.org/xmlns/blueprint/v1.0.0":bean, > "http://www.osgi.org/xmlns/blueprint/v1.0.0":reference, > WC[##other:"http://www.osgi.org/xmlns/blueprint/v1.0.0"]}' is expected. > > I googled a bit and I've seen other examples now. Right now the whitebox.xml > looks as below: > > <?xml version="1.0" encoding="UTF-8"?> > <blueprint > xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" > xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf" > xsi:schemaLocation=" > http://www.osgi.org/xmlns/blueprint/v1.0.0 > http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd > http://cxf.apache.org/blueprint/core > http://cxf.apache.org/schemas/blueprint/core.xsd"> > > <import resource="classpath:META-INF/blackbox.xml"/> > > <camelContext id="whitebox" > xmlns="http://camel.apache.org/schema/blueprint" depends-on="blackbox"> > > <route id="TestWhiteBox"> > <from uri="context:blackbox:testBlackBox"/> > <log message="Called black box from white box"/> > </route> > > </camelContext> > </blueprint> > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/camel-context-only-seems-to-work-within-the-same-file-or-do-I-use-it-wrong-tp5738442p5738477.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).