Thanks Claus, this is unfortunately completely out of the question... I have made some progress: the OSGI detection in org.apache.camel.spring.handler.CamelNamespaceHandler#init doesn't work properly if the camel-spring bundle is being resolved as a dependency: in that situation, in Virgo/Equinox at least, that init() method is called just bfore the bundle's Activator. As far as I can tell the call sequence is entirely driven entirely by Equinox and Gemini, so this may be worth looking into on the Camel side since this could affect quite a few Camel users.
I was able to work around that by explicitly installing the bundle before its dependencies. I am now running into the issue that org.springframework.osgi.context.BundleContextAware seems to only be available from an old spring bundle: org.springframework.osgi: pring-osgi-core:1.2.1 (2009) I am not too sure about adding this as a dependency, is it still compatible with the 3.1.0.RELEASE springframework bundles I am otherwise using? Thanks! Franck From: Claus Ibsen-2 [via Camel] [mailto:ml-node+s465427n5747192...@n5.nabble.com] Sent: Wednesday, February 12, 2014 3:31 PM To: Mangin, Franck Subject: Re: Confused with Camel in Spring/OSGI Hi Camel works the best in Apache Karaf as its OSGi container. That is what we use for development and testing. There may be some caveats and issues running in Eclipse Virgo. If it does not matter for you which osgi container, then I suggest to use Apache Karaf On Wed, Feb 12, 2014 at 1:47 PM, franck102 <[hidden email]</user/SendEmail.jtp?type=node&node=5747192&i=0>> wrote: > I am trying to use Camel 2.12. in a Virgo server, using spring/OSGI since > Virgo's blueprint is based on Gemini. > > The context.xml file below sucessfully starts a camel context... however > breaking in the code shows that I am instantiating a SpringCamelContext > rather than a org.apache.camel.core.osgi.OsgiDefaultCamelContext. > > It looks like I want the org.apache.camel.osgi.CamelContextFactoryBean to > create my camel context, but I just can't figure out how to tell Spring to > use that factory. I have read hundreds of posts about camel, spring & OSGI > and I just can't figure this out, any help would be greatly appreciated! > > I am using maven and having dependencies on camel-core and camel-spring. > It looks like osgi support has been embedded into camel-spring, and so I > should not need or want dependencies on camel-core-osgi or camel-osgi? > > > <?xml version="1.0" encoding="UTF-8"?> > > <beans xmlns="http://www.springframework.org/schema/beans" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation=" > http://www.springframework.org/schema/beans > http://www.springframework.org/schema/beans/spring-beans-3.0.xsd > http://camel.apache.org/schema/spring > http://camel.apache.org/schema/spring/camel-spring.xsd"> > > <camelContext id="ModelCentralCamelContext" > xmlns="http://camel.apache.org/schema/spring"> > <endpoint id="mcedits" uri="seda:mcedits?multipleConsumers=true"/> > > <route> > <from ref="mcedits"/> > <to uri="log:ExampleRouter"/> > </route> > <route> > <from ref="mcedits"/> > <to uri="file:${mcentral-distrib}/eai/mcedits"/> > </route> > </camelContext> > > <bean class="com.fico.modelcentral.eai.context.MCEditProducer"/> > </beans> > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Confused-with-Camel-in-Spring-OSGI-tp5747186.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [hidden email]</user/SendEmail.jtp?type=node&node=5747192&i=1> Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io ________________________________ If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.com/Confused-with-Camel-in-Spring-OSGI-tp5747186p5747192.html To unsubscribe from Confused with Camel in Spring/OSGI, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5747186&code=RnJhbmNrTWFuZ2luQGZpY28uY29tfDU3NDcxODZ8MTQyMTEwMjY2OQ==>. NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately. -- View this message in context: http://camel.465427.n5.nabble.com/Confused-with-Camel-in-Spring-OSGI-tp5747186p5747193.html Sent from the Camel - Users mailing list archive at Nabble.com.