Yeah, I had that. In an OSGi environment, you don't have TypeConverters available until they've been registered as services by the Camel bundles. I built something that uses a ServiceTracker to listen for instances of org.apache.camel.spi.ComponentResolver. One is launched with the camel-core bundle; others are launched with the component bundles. You need there to be something that matches the filter
"((&" + Constants.OBJECTCLASS + "=" + ComponentResolver.class.getName() + ")(component=" + <component name> + "))" So that you know all the components are there before you start apps that depend on them. I can attach a couple samples shortly. Don On Mon, Jun 20, 2011 at 3:31 PM, Michael Furtak <[email protected]> wrote: > Hi Don, > > The exception was: > > org.apache.camel.TypeConverterLoaderException: Failed to load type converters > because of: Cannot find any type converter classes from the following > packages: [org.apache.camel.component.file, org.apache.camel.component.bean, > org.apache.camel.converter] > > Which I assume has to do with trying to use a normal CamelContext in an OSGi > environment. So, OsgiDefaultCamelContext... > > I did come across mention of this in my troubleshooting exploration. It seems > to be part of a bundle called camel-core-osgi, is that right? I don't think I > have it in my 2.7.2 distribution. Is it something I need to bundle myself? I > also saw mention of it being private to the Spring bundle, which is what > prompted my discussion about not wanting to bring in Spring. > > Any further info would be most helpful. > > Thanks, > -Mike > > > > > > > > THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. > IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM > DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your > use of this message for any purpose is strictly prohibited. If you have > received this communication in error, please delete the message and notify > the sender so that we may correct our records. > > -----Original Message----- > > > > From: Donald Whytock [mailto:[email protected]] > Sent: Monday, June 20, 2011 3:10 PM > To: [email protected] > Subject: Re: Camel under OSGi without Spring et al. > > Hi Michael, > > Yes, it's possible. I do it myself. I create my routes in Java, and > I use a service that supplies a singleton CamelContext based on > OsgiDefaultCamelContext. > > What specific problems are you having? > > Don > > On Mon, Jun 20, 2011 at 2:48 PM, Michael Furtak <[email protected]> wrote: >> Hi all, >> >> I have an existing OSGi (Equinox) application into which I would like to >> introduce Camel. I'm quite new to Camel, but I've not had much luck with my >> efforts so far. My problem seems to match that which is discussed in this >> thread: >> >> http://camel.465427.n5.nabble.com/TypeConverters-in-OSGi-td2802220.html >> >> From what I can see, discussions of Camel and OSGi seem to involve Karaf, >> ServiceMix and/or Spring. Is it possible to use Camel in an OSGi environment >> without one of those higher level abstractions? The resolution of that >> thread seems to be to "include Spring", but my application is not >> Spring-based, and I would prefer not to introduce that dependency if at all >> possible. >> >> Thanks in advance for your advice, >> >> + + + + + + + + + + + + + + + + >> Michael Furtak >> Software Engineer >> Cognitive Systems >> Government Services >> Charles River Analytics Inc. >> 617.491.3474 x534 >> www.cra.com<http://www.cra.com/> >> >> >> >> >> >> THIS MESSAGE IS INTENDED FOR THE USE OF THE PERSON TO WHOM IT IS ADDRESSED. >> IT MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM >> DISCLOSURE UNDER APPLICABLE LAW. If you are not the intended recipient, your >> use of this message for any purpose is strictly prohibited. If you have >> received this communication in error, please delete the message and notify >> the sender so that we may correct our records. >> >> >> >> > >
