You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Robson, Alan" <al...@viasat.com> on 2016/01/07 19:46:12 UTC

jena-osgi bundle dependencies

Hi all,

I'm trying to use jena in servicemix (an apache OSGI-based system) by using the jena-osgi bundle...

I can - apparently, install the pre-made bundle from maven...

karaf@root()> bundle:install mvn:org.apache.jena/jena-osgi/3.0.1
Bundle ID: 238

I can install one of my own bundles (actually one that I adapted from http://kevinboone.net/osgitest.html) to satisfy a dependency I have

karaf@root()> feature:install examples-vbb-tick
Tick bundle started

I can then install my new custom feature.

karaf@root()> feature:install examples-vbb-zooby


This all worked until I added code in the zooby bundle to access Jena - I copied in some code snipped from https://github.com/castagna/jena-examples/blob/master/src/main/java/org/apache/jena/examples/ExampleAPI_02.java

All of a sudden, since I added the jena code and started using the OSGI jena bundle I have lots of unresolved dependencies... I believe that all bar one of these is a dependency of the jena-osgi  bundle I downloaded.

Is anyone else seeing these dependency problems ? How did you fix them ?...

Error executing command: Can't install feature examples-vbb-zooby/0.0.0:
Can not resolve feature:
Unsatisfied requirement(s):
---------------------------
   package:(&(package=org.apache.http.client.methods)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.protocol)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.entity))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.impl.client)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.util)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.conn)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.message)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.thrift.protocol)(version>=0.9.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.thrift.meta_data)(version>=0.9.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.conn.scheme)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http))
      Apache Jena - OSGi bundle
   package:(&(package=com.github.jsonldjava.utils)(version>=0.7.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.params)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.commons.lang3.time)(version>=3.3.0)(!(version>=4.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.client.utils)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.commons.cli)(version>=1.3.0)(!(version>=2.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.thrift.scheme)(version>=0.9.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.auth)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.thrift)(version>=0.9.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=com.github.andrewoma.dexx.collection))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.thrift.transport)(version>=0.9.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.client)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.client.entity)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.impl.auth)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.jena.rdf.model)(version>=3.0.0)(!(version>=4.0.0)))
      Apache ServiceMix :: Examples :: VBB :: Zooby
   package:(&(package=org.apache.commons.csv)(version>=1.0.0)(!(version>=2.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=org.apache.http.impl.conn)(version>=4.2.0)(!(version>=5.0.0)))
      Apache Jena - OSGi bundle
   package:(&(package=com.github.jsonldjava.core)(version>=0.7.0)(!(version>=1.0.0)))
      Apache Jena - OSGi bundle

Many thanks

Alan

Re: jena-osgi bundle dependencies

Posted by "A. Soroka" <aj...@virginia.edu>.
Karaf (the OSGi container underlying ServiceMix) is able to resolve transitive dependencies using its “features” system[1], but that kind of resolution is not an inherent ability of OSGi frameworks, it’s specific to Karaf. The OSGi metadata in the Jena bundle just explains what other dependencies exist, not where or how to resolve them. It’s the Maven metadata that explains that, and it’s the fact that Karaf’s “features” system can take advantage of both OSGi metadata and Maven metadata that allows it to solve this kind of problem.

However, you can manually install bundles for those other dependencies (and Jena’s Maven metadata should give you some good information about what they are). You can also use a Karaf feature file to try to do that automatically. Apache Clerezza has done some of that work so you may want to check with them to see what they have available, e.g. [2].


[1] https://karaf.apache.org/manual/latest/users-guide/provisioning.html
[2] https://github.com/apache/clerezza/blob/master/provisioning/rdf/pom.xml

---
A. Soroka
The University of Virginia Library

> On Jan 7, 2016, at 1:46 PM, Robson, Alan <al...@viasat.com> wrote:
> 
> Hi all,
> 
> I'm trying to use jena in servicemix (an apache OSGI-based system) by using the jena-osgi bundle...
> 
> I can - apparently, install the pre-made bundle from maven...
> 
> karaf@root()> bundle:install mvn:org.apache.jena/jena-osgi/3.0.1
> Bundle ID: 238
> 
> I can install one of my own bundles (actually one that I adapted from http://kevinboone.net/osgitest.html) to satisfy a dependency I have
> 
> karaf@root()> feature:install examples-vbb-tick
> Tick bundle started
> 
> I can then install my new custom feature.
> 
> karaf@root()> feature:install examples-vbb-zooby
> 
> 
> This all worked until I added code in the zooby bundle to access Jena - I copied in some code snipped from https://github.com/castagna/jena-examples/blob/master/src/main/java/org/apache/jena/examples/ExampleAPI_02.java
> 
> All of a sudden, since I added the jena code and started using the OSGI jena bundle I have lots of unresolved dependencies... I believe that all bar one of these is a dependency of the jena-osgi  bundle I downloaded.
> 
> Is anyone else seeing these dependency problems ? How did you fix them ?...
> 
> Error executing command: Can't install feature examples-vbb-zooby/0.0.0:
> Can not resolve feature:
> Unsatisfied requirement(s):
> ---------------------------
>   package:(&(package=org.apache.http.client.methods)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.protocol)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.entity))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.impl.client)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.util)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.conn)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.message)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.thrift.protocol)(version>=0.9.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.thrift.meta_data)(version>=0.9.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.conn.scheme)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http))
>      Apache Jena - OSGi bundle
>   package:(&(package=com.github.jsonldjava.utils)(version>=0.7.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.params)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.commons.lang3.time)(version>=3.3.0)(!(version>=4.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.client.utils)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.commons.cli)(version>=1.3.0)(!(version>=2.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.thrift.scheme)(version>=0.9.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.auth)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.thrift)(version>=0.9.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=com.github.andrewoma.dexx.collection))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.thrift.transport)(version>=0.9.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.client)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.client.entity)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.impl.auth)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.jena.rdf.model)(version>=3.0.0)(!(version>=4.0.0)))
>      Apache ServiceMix :: Examples :: VBB :: Zooby
>   package:(&(package=org.apache.commons.csv)(version>=1.0.0)(!(version>=2.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=org.apache.http.impl.conn)(version>=4.2.0)(!(version>=5.0.0)))
>      Apache Jena - OSGi bundle
>   package:(&(package=com.github.jsonldjava.core)(version>=0.7.0)(!(version>=1.0.0)))
>      Apache Jena - OSGi bundle
> 
> Many thanks
> 
> Alan