You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Joery Vreijsen (JIRA)" <ji...@apache.org> on 2018/01/03 10:21:01 UTC

[jira] [Commented] (KARAF-5446) Fragment bundles are not resolved properly when installing/restarting the container

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

Joery Vreijsen commented on KARAF-5446:
---------------------------------------

Hi, 

I was testing this on the Karaf 4.2.0.M2 release, but unfortunately am still experiencing the same problem. 

My steps to reproduce: 
1. Download Apache Karaf 4.2.0.M2 from https://karaf.apache.org/download.html
2. Start Karaf using *bin/karaf*.
Nothing is installed:

{code:java}
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State  │ Lvl │ Version  │ Name
───┼────────┼─────┼──────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active │  80 │ 4.2.0.M2 │ Apache Karaf :: OSGi Services :: Event
{code}

3. Add Smooks features repository and install feature / fragments

{code:java}
karaf@root()> feature:repo-add mvn:org.milyn/milyn-smooks-all/1.5.1/xml/features
karaf@root()> feature:install smooks
karaf@root()> install -s mvn:org.milyn.edi.unedifact/d96a-mapping/1.5-SNAPSHOT
karaf@root()> install -s mvn:org.milyn.edi.unedifact/d96a-binding/1.5-SNAPSHOT
{code}

The bundles are installed, but not resolved (this is expected behaviour!):

{code:java}
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State     │ Lvl │ Version        │ Name
───┼───────────┼─────┼────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active    │  80 │ 4.2.0.M2       │ Apache Karaf :: OSGi Services :: Event
49 │ Active    │  80 │ 1.5.1          │ Smooks OSGi
51 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Mapping Model
52 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Bindings
{code}

Manually refresh, to resolve. Did not work!

{code:java}
karaf@root()> bundle:refresh
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State     │ Lvl │ Version        │ Name
───┼───────────┼─────┼────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active    │  80 │ 4.2.0.M2       │ Apache Karaf :: OSGi Services :: Event
49 │ Active    │  80 │ 1.5.1          │ Smooks OSGi
51 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Mapping Model
52 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Bindings
{code}

Stop Container (ctrl+d)

Restart container: *./bin/karaf*

Fragments are now resolved:

{code:java}
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State    │ Lvl │ Version        │ Name
───┼──────────┼─────┼────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active   │  80 │ 4.2.0.M2       │ Apache Karaf :: OSGi Services :: Event
49 │ Active   │  80 │ 1.5.1          │ Smooks OSGi, Fragments: 52, 51
51 │ Resolved │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Mapping Model, Hosts: 49
52 │ Resolved │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Bindings, Hosts: 49
{code}

Restart container again, Bundles are not resolved

{code:java}
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State     │ Lvl │ Version        │ Name
───┼───────────┼─────┼────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active    │  80 │ 4.2.0.M2       │ Apache Karaf :: OSGi Services :: Event
49 │ Active    │  80 │ 1.5.1          │ Smooks OSGi
51 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Mapping Model
52 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Bindings
{code}

And again, bundle:refresh does not work:


{code:java}
karaf@root()> bundle:refresh
karaf@root()> bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State     │ Lvl │ Version        │ Name
───┼───────────┼─────┼────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
21 │ Active    │  80 │ 4.2.0.M2       │ Apache Karaf :: OSGi Services :: Event
49 │ Active    │  80 │ 1.5.1          │ Smooks OSGi
51 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Mapping Model
52 │ Installed │  80 │ 1.5.0.SNAPSHOT │ Smooks EDI - UN/EDIFACT - D96A - Bindings
{code}

Thanks in advance!

> Fragment bundles are not resolved properly when installing/restarting the container
> -----------------------------------------------------------------------------------
>
>                 Key: KARAF-5446
>                 URL: https://issues.apache.org/jira/browse/KARAF-5446
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 4.1.2
>         Environment: MacOs, downloaded the tar.gz version and started via ./bin/karaf. No custom settings made.
>            Reporter: Markus von Rüden
>            Assignee: Guillaume Nodet
>             Fix For: 4.1.4, 4.2.0.M2
>
>
> h2. Issue description
> When installing a host and a bunch of fragment bundles, the fragments do not get resolved properly.  This worked in Karaf 2.4.3 but does not work anymore in 4.1.2. See steps on how to reproduce.
> h2. How to reproduce
> Run *mvn clean install* on a project with the following pom.xml to get the dependencies in your local .m2 repository:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.example.karaf</groupId>
>   <artifactId>refresh-issue</artifactId>
>   <version>1.0-SNAPSHOT</version>
>   <packaging>jar</packaging>
>   <properties>
>     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
>   </properties>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <version>2.5.1</version>
>         <configuration>
>           <source>1.8</source>
>           <target>1.8</target>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   <dependencies>
>     <dependency>
>       <groupId>com.vaadin</groupId>
>       <artifactId>vaadin-themes</artifactId>
>       <version>7.2.7</version>
>       <scope>provided</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.opennms.features.themes</groupId>
>       <artifactId>jmxconfiggenerator-theme</artifactId>
>       <version>21.0.0</version>
>       <scope>provided</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.opennms.features.themes</groupId>
>       <artifactId>dashboard-theme</artifactId>
>       <version>21.0.0</version>
>       <scope>provided</scope>
>     </dependency>
>     <dependency>
>       <groupId>org.opennms.features.themes</groupId>
>       <artifactId>onms-default-theme</artifactId>
>       <version>21.0.0</version>
>       <scope>provided</scope>
>     </dependency>
>   </dependencies>
>   <repositories>
>     <repository>
>       <snapshots><enabled>false</enabled></snapshots>
>       <releases><enabled>true</enabled></releases>
>       <id>opennms-repo</id>
>       <name>OpenNMS Repository</name>
>       <url>http://maven.opennms.org/content/groups/opennms.org-release</url>
>     </repository>
>   </repositories>
> </project>
> {code}
> Download latest Karaf 4.1.2 version and start it:
> *./bin/karaf*
> Nothing installed:
> {code}
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State  │ Lvl │ Version │ Name
> ───┼────────┼─────┼─────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> karaf@root()>
> {code}
> Install host and fragments:
> {code}
> install -s mvn:com.vaadin/vaadin-themes/7.2.7
> install mvn:org.opennms.features.themes/dashboard-theme/21.0.0
> install mvn:org.opennms.features.themes/jmxconfiggenerator-theme/21.0.0
> install mvn:org.opennms.features.themes/onms-default-theme/21.0.0
> {code}
> The bundles are installed, but not resolved (this is expected behaviour!):
> {code}
> araf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State     │ Lvl │ Version │ Name
> ───┼───────────┼─────┼─────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active    │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> 52 │ Active    │  80 │ 7.2.7   │ vaadin-themes
> 53 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Dashboard
> 54 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: JMX Configuration Generator
> 55 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Default
> karaf@root()>
> {code}
> Manually refresh, to resolve. Did not work!
> {code}
> karaf@root()> bundle:refresh
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State     │ Lvl │ Version │ Name
> ───┼───────────┼─────┼─────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active    │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> 52 │ Active    │  80 │ 7.2.7   │ vaadin-themes
> 53 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Dashboard
> 54 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: JMX Configuration Generator
> 55 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Default
> {code}
> Stop Container (ctrl+d)
> Restart container: *./bin/karaf*
> Fragments are now resolved:
> {code}
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State    │ Lvl │ Version │ Name
> ───┼──────────┼─────┼─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active   │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> 52 │ Active   │  80 │ 7.2.7   │ vaadin-themes, Fragments: 54, 55, 53
> 53 │ Resolved │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Dashboard, Hosts: 52
> 54 │ Resolved │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: JMX Configuration Generator, Hosts: 52
> 55 │ Resolved │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Default, Hosts: 52
> {code}
> Restart container again, Bundles are not resolved
> {code}
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State     │ Lvl │ Version │ Name
> ───┼───────────┼─────┼─────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active    │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> 52 │ Active    │  80 │ 7.2.7   │ vaadin-themes
> 53 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Dashboard
> 54 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: JMX Configuration Generator
> 55 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Default
> {code}
> And again, bundle:refresh does not work:
> {code}
> karaf@root()> bundle:refresh
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
> ID │ State     │ Lvl │ Version │ Name
> ───┼───────────┼─────┼─────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> 28 │ Active    │  80 │ 4.1.2   │ Apache Karaf :: OSGi Services :: Event
> 52 │ Active    │  80 │ 7.2.7   │ vaadin-themes
> 53 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Dashboard
> 54 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: JMX Configuration Generator
> 55 │ Installed │  80 │ 21.0.0  │ OpenNMS :: Features :: Vaadin :: Theme :: Default
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)