[ 
https://issues.apache.org/jira/browse/KARAF-6919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17236899#comment-17236899
 ] 

Peter Rader commented on KARAF-6919:
------------------------------------

Thank you. I removed karaf-4.3.0 and reinstalled it again for a clean state.

Then I used the commands unfortunately I failed.
{code:java}
karaf@root()> feature:repo-add 
mvn:org.apache.aries.cdi/aries-cdi-feature/1.1.2/xml/features
Adding feature url mvn:org.apache.aries.cdi/aries-cdi-feature/1.1.2/xml/features
karaf@root()> feature:install osgi-cdi-owb
Error executing command: Unable to resolve root: missing requirement [root] 
osgi.identity; osgi.identity=osgi-cdi-owb; type=karaf.feature; 
version="[0,0.0.0]"; 
filter:="(&(osgi.identity=osgi-cdi-owb)(type=karaf.feature)(version>=0.0.0)(version<=0.0.0))"
 [caused by: Unable to resolve osgi-cdi-owb/0.0.0: missing requirement 
[osgi-cdi-owb/0.0.0] osgi.identity; osgi.identity=openwebbeans-impl; 
type=osgi.bundle; version="[2.0.17,2.0.17]"; resolution:=mandatory [caused by: 
Unable to resolve openwebbeans-impl/2.0.17: missing requirement 
[openwebbeans-impl/2.0.17] osgi.wiring.package; 
filter:="(&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))"]]
karaf@root()>
{code}
Furthermore I ask myself if I can get rid of the owb because I do not need web 
for CDI. Finally I deep downloaded possible requirements. Now I facing the 
problem that I can not find implementor of {{osgi.serviceloader.processor}}.

This is my current state:
{code:java}
karaf@root()> bundle:list -l
START LEVEL 100 , List Threshold: 50
ID | State     | Lvl | Version | Location
---+-----------+-----+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
31 | Active    |  80 | 4.3.0   | 
mvn:org.apache.karaf/org.apache.karaf.event/4.3.0
54 | Active    |  80 | 4.17.0  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/xbean-bundleutils-4.17.jar
55 | Active    |  80 | 4.17.0  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/xbean-asm8-shaded-4.17.jar
56 | Active    |  80 | 4.17.0  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/xbean-finder-shaded-4.17.jar
57 | Active    |  80 | 2.0.17  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/openwebbeans-spi-2.0.17.jar
58 | Installed |  80 | 1.1.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.aries.cdi.extender-1.1.2.jar
59 | Installed |  80 | 2.0.17  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/openwebbeans-web-2.0.17.jar
60 | Installed |  80 | 1.1.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.aries.cdi.extension.spi-1.1.2.jar
61 | Installed |  80 | 1.1.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.aries.cdi.extra-1.1.2.jar
62 | Installed |  80 | 1.1.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.aries.cdi.spi-1.1.2.jar
63 | Active    |  80 | 2.0.17  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/openwebbeans-el22-2.0.17.jar
64 | Installed |  80 | 1.1.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.aries.cdi.owb-1.1.2.jar
65 | Active    |  80 | 1.0.12  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/org.apache.felix.converter-1.0.12.jar
66 | Installed |  80 | 2.0.17  | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/openwebbeans-impl-2.0.17.jar
67 | Installed |  80 | 1.1.0   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/geronimo-el_2.2_spec-1.1.jar
68 | Active    |  80 | 2.0.0   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/cdi-api-2.0.jar
69 | Active    |  80 | 1       | 
wrap:file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/javax.inject-1.jar$Bundle-SymbolicName=javax.inject&Bundle-Version=1
71 | Active    |  80 | 1.2     | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/javax.interceptor-api-1.2.jar
72 | Active    |  80 | 3.0.0   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/javax.el-api-3.0.0.jar
73 | Active    |  80 | 1.3.2   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/javax.annotation-api-1.3.2.jar
74 | Installed |  80 | 1.3.0   | 
file:/C:/Program%20Files/apache-karaf-4.3.0/deploy/geronimo-jcdi_2.0_spec-1.3.jar
karaf@root()> start 64
Error executing command: Error executing command on bundles:
        Error starting bundle 64: Unable to resolve org.apache.aries.cdi.owb 
[64](R 64.0): missing requirement [org.apache.aries.cdi.owb [64](R 64.0)] 
osgi.wiring.package; 
(&(osgi.wiring.package=org.apache.aries.cdi.spi.loader)(version>=1.0.0)(!(version>=2.0.0)))
 [caused by: Unable to resolve org.apache.aries.cdi.spi [62](R 62.0): missing 
requirement [org.apache.aries.cdi.spi [62](R 62.0)] osgi.contract; 
(&(osgi.contract=JavaCDI)(version=2.0.0)) [caused by: Unable to resolve 
org.apache.geronimo.specs.geronimo-jcdi_2.0_spec [74](R 74.0): missing 
requirement [org.apache.geronimo.specs.geronimo-jcdi_2.0_spec [74](R 74.0)] 
osgi.extender; (osgi.extender=osgi.serviceloader.processor)]] Unresolved 
requirements: [[org.apache.aries.cdi.owb [64](R 64.0)] osgi.wiring.package; 
(&(osgi.wiring.package=org.apache.aries.cdi.spi.loader)(version>=1.0.0)(!(version>=2.0.0)))]
karaf@root()>                                                                   
                                                                                
                                            
{code}
Do you know a implementor of {{osgi.serviceloader.processor}}?

> 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)

Reply via email to