Peter Rader created KARAF-6919:
----------------------------------

             Summary: Karaf 4.3 can not load CDI Bundle having OSGi Services
                 Key: KARAF-6919
                 URL: https://issues.apache.org/jira/browse/KARAF-6919
             Project: Karaf
          Issue Type: Bug
          Components: karaf
    Affects Versions: 4.3.0
         Environment: Windows x64

JDK1.8
            Reporter: Peter Rader


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:
{code:xml}
<dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.cdi</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
</dependency>
{code}
And I create a class TestBean:
{code:java}
package de.e_nexus.vr.server.osgi;
import org.osgi.service.cdi.annotations.Service;
@Service
public class TestBean {
}
{code}
Unfortunately the result can not be load:

 
{code:java}
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)))]
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to