You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Hubert Felber <Hu...@abacus.ch> on 2015/09/29 18:31:11 UTC

PaxExam --- 'javax.xml.stream' exposed via two dependency chains

Hi, 
I would like to test a bundle in PaxExam with
org.apache.felix.framework, but cannot get it to run because of the
error below

Unable to resolve resource core [core [31](R 31.0)] because it is
exposed to package 'javax.xml.stream' 
from resources org.apache.felix.framework [org.apache.felix.framework
[0](R 0)] and 
org.apache.servicemix.specs.stax-api-1.0
[org.apache.servicemix.specs.stax-api-1.0 [24](R 24.0)] via two
dependency chains.

Is there a solution for this problem? I did find any.

Thank you
Hubert

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


Re: PaxExam --- 'javax.xml.stream' exposed via two dependency chains

Posted by Hubert Felber <Hu...@abacus.ch>.
Hi Balázs

<<Hope this helps!

I hope so :-), I spent too long trying this to get to work, including setting some  system packages, wich obviously was not enough.
Thank you ! Will let you know the result.

kind regards
Hubert

>>> Balázs Zsoldos<ba...@everit.biz> 29.09.2015 20:31 >>>
Hi Hubert,

I normally do not use javax.xml packages from the JDK. I created a bundle
that

   - contains all xml-apis (all basic xml API)
   - contains implementation for all API
   - overrides some classes to use always the classloader of the bundle to
   find implementations (when factory classes are used)

The bundle is available on maven-central:
http://search.maven.org/#artifactdetails%7Corg.everit.osgi.bundles%7Corg.everit.osgi.bundles.org.apache.xmlcommons.full%7C1.4.1-20150918%7Cbundle 

If you use the bundle I mentioned, you should not install stax-api or any
other bundle that contains standard xml related API. Please note that the
bundle is intended for runtime use, not for compile time.

I use only that many packages from the JDK as it is really necessary (e.g.:
I use javax.sql.* packages from a bundle, too). I do that by specifying
system packages. With pax-exam, it is possible to define system-packages,
too. See:
http://stackoverflow.com/questions/18445194/how-to-specify-system-package-exports-in-pax-exam 

If you use maven and want to know the list of packages that are not
available in any of your dependency (expecting that your dependencies are
OSGi bundles), you can use the following command:

mvn org.everit.osgi.dev:eosgi-maven-plugin:analyse

This goal checks your dependencies and writes out what could be missing
(including all JDK based packages). By having a look on the list, it is
much easier to define the system-packages.

Hope this helps!

Kind regards,
*Balázs **Zsoldos*


On Tue, Sep 29, 2015 at 6:31 PM, Hubert Felber <Hu...@abacus.ch>
wrote:

> Hi,
> I would like to test a bundle in PaxExam with
> org.apache.felix.framework, but cannot get it to run because of the
> error below
>
> Unable to resolve resource core [core [31](R 31.0)] because it is
> exposed to package 'javax.xml.stream'
> from resources org.apache.felix.framework [org.apache.felix.framework
> [0](R 0)] and
> org.apache.servicemix.specs.stax-api-1.0
> [org.apache.servicemix.specs.stax-api-1.0 [24](R 24.0)] via two
> dependency chains.
>
> Is there a solution for this problem? I did find any.
>
> Thank you
> Hubert
>
> ---------------------------------------------------------------------
> 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


Re: PaxExam --- 'javax.xml.stream' exposed via two dependency chains

Posted by Balázs Zsoldos <ba...@everit.biz>.
Hi Hubert,

I normally do not use javax.xml packages from the JDK. I created a bundle
that

   - contains all xml-apis (all basic xml API)
   - contains implementation for all API
   - overrides some classes to use always the classloader of the bundle to
   find implementations (when factory classes are used)

The bundle is available on maven-central:
http://search.maven.org/#artifactdetails%7Corg.everit.osgi.bundles%7Corg.everit.osgi.bundles.org.apache.xmlcommons.full%7C1.4.1-20150918%7Cbundle

If you use the bundle I mentioned, you should not install stax-api or any
other bundle that contains standard xml related API. Please note that the
bundle is intended for runtime use, not for compile time.

I use only that many packages from the JDK as it is really necessary (e.g.:
I use javax.sql.* packages from a bundle, too). I do that by specifying
system packages. With pax-exam, it is possible to define system-packages,
too. See:
http://stackoverflow.com/questions/18445194/how-to-specify-system-package-exports-in-pax-exam

If you use maven and want to know the list of packages that are not
available in any of your dependency (expecting that your dependencies are
OSGi bundles), you can use the following command:

mvn org.everit.osgi.dev:eosgi-maven-plugin:analyse

This goal checks your dependencies and writes out what could be missing
(including all JDK based packages). By having a look on the list, it is
much easier to define the system-packages.

Hope this helps!

Kind regards,
*Balázs **Zsoldos*


On Tue, Sep 29, 2015 at 6:31 PM, Hubert Felber <Hu...@abacus.ch>
wrote:

> Hi,
> I would like to test a bundle in PaxExam with
> org.apache.felix.framework, but cannot get it to run because of the
> error below
>
> Unable to resolve resource core [core [31](R 31.0)] because it is
> exposed to package 'javax.xml.stream'
> from resources org.apache.felix.framework [org.apache.felix.framework
> [0](R 0)] and
> org.apache.servicemix.specs.stax-api-1.0
> [org.apache.servicemix.specs.stax-api-1.0 [24](R 24.0)] via two
> dependency chains.
>
> Is there a solution for this problem? I did find any.
>
> Thank you
> Hubert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>