You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Jean-Baptiste Onofré (Jira)" <ji...@apache.org> on 2020/11/21 13:19:00 UTC
[jira] [Resolved] (KARAF-6919) Karaf 4.3 can not load CDI Bundle
having OSGi Services
[ https://issues.apache.org/jira/browse/KARAF-6919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Baptiste Onofré resolved KARAF-6919.
-----------------------------------------
Resolution: Not A Problem
> 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
> Assignee: Jean-Baptiste Onofré
> Priority: Minor
> Labels: bundle, cdi, ioc, osgi
>
> 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)