This does not solve the problem at all.

Also not installing Equinox DS or Event but just the split compendium
event package and e.g. the http feature could result in the
feature:list error.
"Error executing command: Service configuration is null. :
mvn:org.apache.karaf.features/framework/4.0.1/xml/features"


What I have done:

I created a bundle that contains only the org/osgi/service/event
package of mvn:org.osgi/org.osgi.compendium/5.0.0.

jar tvf 
/home/rathgeb/tmp/wrap-bundle/event/target/org.osgi.compendium.split.service.event-5.0.0.jar
==
   630 Mon Aug 31 16:08:12 CEST 2015 META-INF/MANIFEST.MF
     0 Mon Aug 31 16:08:12 CEST 2015 META-INF/
     0 Mon Aug 31 16:08:12 CEST 2015 META-INF/maven/
     0 Mon Aug 31 16:08:12 CEST 2015 META-INF/maven/tmp.need.a.home/
     0 Mon Aug 31 16:08:12 CEST 2015
META-INF/maven/tmp.need.a.home/org.osgi.compendium.split.service.event/
   164 Mon Aug 31 16:08:12 CEST 2015
META-INF/maven/tmp.need.a.home/org.osgi.compendium.split.service.event/pom.properties
  2092 Mon Aug 31 16:07:58 CEST 2015
META-INF/maven/tmp.need.a.home/org.osgi.compendium.split.service.event/pom.xml
     0 Mon Aug 31 16:08:12 CEST 2015 org/
     0 Mon Aug 31 16:08:12 CEST 2015 org/osgi/
     0 Mon Aug 31 16:08:12 CEST 2015 org/osgi/service/
     0 Mon Aug 31 16:08:12 CEST 2015 org/osgi/service/event/
  2746 Thu May 09 16:17:32 CEST 2013
org/osgi/service/event/Event$FilterProperties.class
  3721 Thu May 09 16:17:32 CEST 2013 org/osgi/service/event/Event.class
   200 Thu May 09 16:17:32 CEST 2013 org/osgi/service/event/EventAdmin.class
  1211 Thu May 09 16:17:32 CEST 2013 org/osgi/service/event/EventConstants.class
   186 Thu May 09 16:17:32 CEST 2013 org/osgi/service/event/EventHandler.class
  4242 Thu May 09 16:17:32 CEST 2013
org/osgi/service/event/EventProperties.class
  4724 Thu May 09 16:17:32 CEST 2013
org/osgi/service/event/TopicPermission.class
  5086 Thu May 09 16:17:32 CEST 2013
org/osgi/service/event/TopicPermissionCollection.class
   128 Thu May 09 16:17:32 CEST 2013 org/osgi/service/event/package-info.class
    12 Sat Feb 09 22:03:44 CET 2013 org/osgi/service/event/packageinfo
==

Manifest:
==
Manifest-Version: 1.0
Bnd-LastModified: 1441030093166
Build-Jdk: 1.7.0_80
Built-By: rathgeb
Bundle-Description: This OSGi bundle simply extract the event package of
  the whole compendium bundle.
Bundle-ManifestVersion: 2
Bundle-Name: Stripped down compendium for event only
Bundle-SymbolicName: org.osgi.compendium.split.service.event
Bundle-Version: 5.0.0
Created-By: Apache Maven Bundle Plugin
Export-Package: org.osgi.service.event;version="1.3";uses:="org.osgi.fra
 mework"
Import-Package: org.osgi.framework
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.5))"
Tool: Bnd-2.3.0.201405100607
==


Started Karaf 4.0.1 with a clean environment using:
$ bin/karaf clean


Install the Event API:
karaf@root()> bundle:install
file:/home/rathgeb/tmp/wrap-bundle/event/target/org.osgi.compendium.split.service.event-5.0.0.jar
Bundle ID: 33


Install http feature:
karaf@root()> feature:install http


So, Karaf restarts themselves:

        __ __                  ____
       / //_/____ __________ _/ __/
      / ,<  / __ `/ ___/ __ `/ /_
     / /| |/ /_/ / /  / /_/ / __/
    /_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (4.0.1)

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.

karaf@root()>


When I now type feature:list, I will get the error message.


karaf@root()> feature:list
Error executing command: Service configuration is null. :
mvn:org.apache.karaf.features/framework/4.0.1/xml/features


But to get org.eclipse.equinox.event working, I think I need the API...


Could you help me again? ;-)

2015-08-31 15:12 GMT+02:00 Achim Nierbeck <[email protected]>:
> If you declare those packages as being exported in the maven-bundle-plugin
> section and you only have the osgi jar as dependency in your maven
> dependency,
> that should do the trick already to only contain those packages which you
> explicitly export.
>
> regards, Achim
>
>
> 2015-08-31 14:43 GMT+02:00 Markus Rathgeb <[email protected]>:
>>
>> Thank you.
>> Okay, then I think the easiest way to get Equinox DS working would be
>> to create a very small bundle, that contains the
>> org.osgi.service.component package only.
>> If I have to create such small API bundles for some other packages,
>> too, I would like to use the maven-bundle-plugin in a similar way to
>> this one:
>>
>> https://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html#Staticallybundlingjars
>> So, using the org.eclipse.osgi.services or org.osgi.compendium bundle
>> and create a new bundle containing only one package of that one.
>> Do you think, I could do this with the maven-bundle-plugin?
>>
>> 2015-08-31 14:30 GMT+02:00 Achim Nierbeck <[email protected]>:
>> > Hi Markus,
>> >
>> > if those packages you need aren't included in the ds bundle,
>> > I think it's ok to do a "micro" re-packaging and either by adding a
>> > fragment-bundle with the appropriate classes and meta-inf information to
>> > the
>> > equinox-ds bundle or create a standalone bundle that only contains those
>> > packages in need.
>> > With that you make sure you only provide the packages needed at the
>> > time.
>> >
>> > If you do this, the feature:list will work again, even without
>> > restarting
>> > the container.
>> >
>> > regards, Achim
>> >
>> >
>> >
>> > 2015-08-31 14:20 GMT+02:00 Markus Rathgeb <[email protected]>:
>> >>
>> >> Hello,
>> >> I have to use the Equinox OSGi framework and Equinox DS in a Karaf
>> >> container.
>> >>
>> >> The Equinox OSGi framework is no problem at all.
>> >> I added "karaf.framework=equinox" to "etc/custom.properties" and
>> >> started
>> >> Karaf.
>> >>
>> >> To install DS of Equinox I installed first the Equnix util bundle and
>> >> after that Equinox DS bundle:
>> >> bundle:install
>> >>
>> >> http://repository.grepcode.com/java/eclipse.org/4.4.1/plugins/org.eclipse.equinox.util_1.0.500.v20130404-1337.jar
>> >> bundle:install
>> >>
>> >> http://repository.grepcode.com/java/eclipse.org/4.4.1/plugins/org.eclipse.equinox.ds_1.4.200.v20131126-2331.jar
>> >>
>> >> The Equinox DS bundle could not be started because its
>> >> "Import-Package" line for
>> >> org.osgi.service.component;version="[1.1,1.3)"
>> >> It does not export org.osgi.service.component themselves as it is done
>> >> by org.apache.felix.scr.
>> >>
>> >> Perhaps the difference between the two bundles are exact this one:
>> >>
>> >>
>> >> http://felix.apache.org/documentation/tutorials-examples-and-presentations/apache-felix-osgi-faq.html#should-a-service-providerconsumer-bundle-be-packaged-with-its-service-api-packages
>> >>
>> >> So, but I have to use Equinox DS.
>> >>
>> >> It is working, if I install the "org.eclipse.osgi.services" bundle,
>> >> but this could be incorrect similar to install a org.osgi.compendium
>> >> bundle.
>> >>
>> >> I have already read the reply of JBO in this topic years ago:
>> >>
>> >>
>> >> http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html#a4026905
>> >>
>> >> "You don't have (and must not ;)) put compendium jar in the deploy
>> >> folder."
>> >>
>> >> But which packages can be added to "org.osgi.framework.system.packages"
>> >> at
>> >> all?
>> >> The Equinox OSGi bundle does not contain the org.osgi.service.component
>> >> package.
>> >>
>> >> Same problem as DS also exists for Equinox Event bundle.
>> >>
>> >> Ah, and if I installed "org.eclipse.osgi.services" feature:list will
>> >> not work until the next restart of Karaf.
>> >> But as I should not install the bundle, this just as a note.
>> >>
>> >> Could you give me some tips?
>> >>
>> >> Best regards,
>> >> Markus
>> >
>> >
>> >
>> >
>> > --
>> >
>> > Apache Member
>> > Apache Karaf <http://karaf.apache.org/> Committer & PMC
>> > OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
>> > &
>> > Project Lead
>> > blog <http://notizblog.nierbeck.de/>
>> > Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>> >
>> > Software Architect / Project Manager / Scrum Master
>> >
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>

Reply via email to