Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6919

Karaf 4.3 can not load CDI Bundle having OSGi Services

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 4.3.0
    • None
    • karaf
    • Windows x64

      JDK1.8

    Description

      Folowing https://blog.osgi.org/2018/08/osgi-r7-highlights-cdi-integration.html a annotation is used: org.osgi.service.cdi.annotations.Service

      Therefore I add this dependency to my maven project:

      <dependency>
      	<groupId>org.osgi</groupId>
      	<artifactId>org.osgi.service.cdi</artifactId>
      	<version>1.0.0</version>
      	<scope>provided</scope>
      </dependency>
      

      And I create a class TestBean:

      package de.e_nexus.vr.server.osgi;
      import org.osgi.service.cdi.annotations.Service;
      @Service
      public class TestBean {
      }
      

      Unfortunately the result can not be load:

       

      11:24:10.552 WARN [fileinstall-C:\Program Files\apache-karaf-4.3.0/deploy] Error while starting bundle: file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/vr.server-1.0.0.jar
      org.osgi.framework.BundleException: Unable to resolve VR-Server [87](R 87.0): missing requirement [VR-Server [87](R 87.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.cdi.annotations)(version>=1.0.0)(!(version>=2.0.0))) Unresolved requirements: [[VR-Server [87](R 87.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.cdi.annotations)(version>=1.0.0)(!(version>=2.0.0)))]
      

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              Grim Peter Rader
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: