camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Younes Ouadi <younes.ou...@gmail.com>
Subject Using CamelTestSupport within OSGI Environment
Date Wed, 27 Jul 2011 08:21:02 GMT
Dears,

I have wrapped CamelTestSupport in a service to allow testing Camel Routes
from GUI. The service works fine in a standalone application (unit tests) as
well as in a JEE application. When I tried the same service within an OSGI
environment (Karaf), I got the following error:

java.lang.RuntimeException: javax.naming.NoInitialContextException: We could
not find a provider for the InitialContextFactory
org.apache.camel.util.jndi.CamelInitialContextFactory

After some research, I have found that Camel 'itests' class
OSGiIntegrationTestSupport extends also the CamelTestSupport class and
override 'createCamelContext()' where 'CamelContextFactory' is used to
instantiate the context instead of using an instance of
'DefaultCamelContext'.

My issue with 'CamelContextFactory' is that it requires a dependency to the
'BundleContext' and makes my service coupled to OSGI API.

My questions are:
* Is my diagnostic is correct?
* Is this the only way to use CamelTestSupport from within an OSGI
environment?

Some information about my environment:
* Camel: 2.8.0
* Karaf: 2.2.1
* Aries: 0.3.1
* JDK: 1.6

Warm regards

Younes Ouadi



--
View this message in context: http://camel.465427.n5.nabble.com/Using-CamelTestSupport-within-OSGI-Environment-tp4637949p4637949.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message