This is a know problem. Karaf and Pax exam both load a bundle containing javax.inject. I solved this for karaf 4.0.3 by simply using the same bundle.
So it is only loaded once. I am not sure if dependency=true would help.

In any case the problem is solved in karaf 4.0.3.

Christian


On 06.11.2015 17:14, Alex Soto wrote:
Hello,

I have a problem with @Inject in my integration test (Karaf 4.0.2 and Pax-Exam 4.6.0). Dependencies are not injected. For example:

@Inject
protected BundleContext bundleContext;

The problem seems to be caused by one the features being tested, which includes this bundle:


<bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax-inject/1_2</bundle>


This feature contains bundles that also use the @Inject annotation. If I remove the above /<bundle>/ declaration from my features.xml, then the problem goes away, but then I need to have this jar deployed at runtime. So, which bundle should I be using that contains Inject and that works with Pax-Exam as well for runtime?

Best regards,

Alex soto




--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to