You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benson Margulies <be...@basistech.com> on 2015/12/07 21:32:34 UTC

When two bundles compete to export a package ...

I am trying to use @Inject in a pax-exam test.

pax-exam uses <dependency>

    <groupId>org.apache.geronimo.specs</groupId>
    <artifactId>geronimo-atinject_1.0_spec</artifactId>
    <version>${dependency.atinject.version}</version>
</dependency>

Karaf 4 uses the alternative from servicemix.

When I use the karaf container to test, I end up with both. And, as
luck would have it, pax-exam ends up with Inject.class from the
servicemix bundle, while my test ends up with it from the geronimo
bundle.

I don't know how the geronimo bundle gets itself provisioned; but I
assume that pax-exam is arranging this somehow.

anyway, is there any OSGi header i can use to encourage my test bundle
to wire to the servicemix bundle?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: When two bundles compete to export a package ...

Posted by Hubert Felber <Hu...@abacus.ch>.
Are you importing  org.ops4j.pax.exam.Inject ?
If yes, then try javax.inject.Inject 



>>> Benson Margulies <be...@basistech.com> 07.12.2015 21:32 >>>
I am trying to use @Inject in a pax-exam test.

pax-exam uses <dependency>

    <groupId>org.apache.geronimo.specs</groupId>
    <artifactId>geronimo-atinject_1.0_spec</artifactId>
    <version>${dependency.atinject.version}</version>
</dependency>

Karaf 4 uses the alternative from servicemix.

When I use the karaf container to test, I end up with both. And, as
luck would have it, pax-exam ends up with Inject.class from the
servicemix bundle, while my test ends up with it from the geronimo
bundle.

I don't know how the geronimo bundle gets itself provisioned; but I
assume that pax-exam is arranging this somehow.

anyway, is there any OSGi header i can use to encourage my test bundle
to wire to the servicemix bundle?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org 
For additional commands, e-mail: users-help@felix.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org