Hi

the resolver behavior is not exactly the same if you do:

feature:install foo

or

feature:install jms bar foo

If you feature expects another feature providing a service, than, the "dependency" feature should be completely installed and started to provide the services before your feature is install.

For instance, if you have:

<feature name="my" version="xx">
    <feature>foo</feature>
    <bundle>mvn:my/my/xx</bundle>
</feature>

If "my" bundle has a requirement to a service provided by foo, then, you can have an issue as foo can be installed async. So, in that case, you should first install and start foo first. You can achieve this using prerequisite flag:

<feature name="my" version="xx">
    <feature prerequisite="true">foo</feature>
    <bundle>mvn:my/my/xx</bundle>
</feature>

Do you think you are in this case ?

Regards
JB


On 05/09/2018 09:42, Miroslav Beranič wrote:
Hi giys,

I am tracking mailing list last few weeks, can be, I missed some mails.

So, I think I have similar issue that what reported few days ago from Thiago, with title "Unable to deploy a Karaf kar file containing a ComponentFactory OSGi declarative service".

I have application porting from ServiceMix 7.0.2 ( build from ServiceMix GitHub master ) to Karaf 4.2.x ( fist 4.2.1 and now 4.2.2, both Github source ).

I have application in multiple Karaf Features. In ServiceMix 7.0.2 ( Karaf 4.0.9 ) I install application with on "super parent" feature, that is a tree of features ( XSD Feature namespace 1.0 ), so without dependencies or prerequisite attributes.

Same set of features, when deployed in Karaf 4.2.x is "blocked", it stops in different steps, at different features. But this is in features of pre-defined features, like JMS, JPA, Hibernate, ActiveMQ, ...

Strange thing is, when I install one single feature at a time it works. For example ( there is multiple such feature groups, just one here ):

<feature name="my-infrastructure-requirements-jms" version="${project.version}">
<feature>aries-blueprint-spring</feature>
        <feature version="[4.2.2, 5)">shell-compat</feature>
        <feature version="[5.15.7, 6)">activemq-broker</feature>
        <feature version="[5.15.7, 6)">activemq-cf</feature>
        <feature version="[5.15.7, 6)">activemq-blueprint</feature>
<bundle>mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.camel/7.1.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/7.1.0-SNAPSHOT</bundle>

        <feature version="[4.2.2, 5)">jms</feature>
        <feature version="[2.23.0, 3)">camel</feature>
        <feature version="[2.23.0, 3)">camel-spring</feature>
        <feature version="[2.23.0, 3)">camel-jms</feature>
        <feature version="[2.23.0, 3)">camel-blueprint</feature>
        <feature version="[2.23.0, 3)">camel-cxf</feature>
        <feature version="[2.23.0, 3)">camel-jpa</feature>
        <feature version="[1.0.2, 2)">pax-jms-activemq</feature>
        <configfile finalname="/etc/org.apache.servicemix.activemq.service.cfg">
mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/${project.version}/cfg/activemq-service
        </configfile>
</feature>

So almost always it stops somewhere when installing this feature, but when I install it one by one -- it works. ( it never installed when installing "feature groups", this is the "feature group" it stops most of the time, other is JPA related "feature group" ).

so: feature:install my-infrastructure-requirements-jms

has message in log:
2018-09-05T09:16:08,539 | INFO  | pipe-feature:install my-infrastructure-requirements-jms | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.2.2.SNAPSHOT | Adding features: my-infrastructure-requirements-jms/[2.0.0,2.0.0]

That is all there is ... and it waits here, for ever. So it seems there is really a condition race. So when I saw mail from Thiago, I am even more sure, this is true.

Here is full feature file. Please note, I have some features, to "fix" feature install order - spring is a mess, as it starts to install version 5, as "best one" but this is not the case for me - as I want to use ActiveMQ. ( you can see I also use "future" version of ActiveMQ 5.15.7 - my own build with updated versions of dependencies in ActiveMQ, same behaviour is with "stock" version, so I do not see problem in this ). Other issue ( was ) with Jetty version 9.4.10 and 9.4.11, but this is fixed no in Karaf.

Also ServiceMix 7.1.0-SNAPSHOT is my own build of source code from 7.0.2-SNAPSHOT, to re-use ActiveMQ connection factory ( this is Servicemix 7.0.2 with updated Camel version ).

Here I use feature xsd namespace 1.4.0

<?xml version="1.0" encoding="UTF-8"?>
<features name="framework-${project.version}"
          xmlns="http://karaf.apache.org/xmlns/features/v1.4.0";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.4.0 http://karaf.apache.org/xmlns/features/v1.4.0";>

<repository>mvn:org.apache.camel.karaf/apache-camel/${org.apache.camel.version}/xml/features</repository>
<repository>mvn:org.apache.activemq/activemq-karaf/${org.apache.activemq.version}/xml/features</repository>
<repository>mvn:org.apache.karaf.features/spring-legacy/${org.apache.karaf.version}/xml/features</repository>
<repository>mvn:org.ops4j.pax.jms/pax-jms-features/${org.ops4j.pax.jms.version}/xml/features</repository>
<repository>mvn:org.ops4j.pax.web/pax-web-features/${org.ops4j.pax.web.version}/xml/features</repository>

    <feature name="my-infrastructure-requirements-spring-43" version="${project.version}">
        <feature version="[4.3.18, 5)">spring</feature>
        <feature version="[4.3.18, 5)">spring-tx</feature>
        <feature version="[4.3.18, 5)">spring-jms</feature>
        <feature version="[4.3.18, 5)">spring-orm</feature>
        <feature version="[4.3.18, 5)">spring-oxm</feature>
        <!-- Jetty -->
        <feature version="[4.3.18, 5)">spring-web</feature>
        <feature version="[4.3.18, 5)">spring-web-portlet</feature>
        <feature version="[4.3.18, 5)">spring-websocket</feature>
    </feature>

    <feature name="my-infrastructure-requirements-cxf" version="${project.version}">
        <feature version="[3.2.5, 4)">cxf</feature>
        <feature version="[3.2.5, 4)">cxf-jaxws</feature>
        <feature version="[3.2.5, 4)">cxf-jaxrs</feature>
    </feature>

    <feature name="my-infrastructure-requirements-jpa" version="${project.version}">
        <feature version="[4.2.2, 5]">jdbc</feature>
        <feature version="[2.7.0, 3)">jpa</feature>
        <feature version="[5.2.9, 6)">hibernate</feature>
        <feature version="[1.3.0, 2)">pax-jdbc-postgresql</feature>
        <feature version="[1.3.0, 2)">pax-jdbc-pool-c3p0</feature>
        <feature version="[4.2.2, 5)">aries-blueprint</feature>
        <capability>
osgi.service;objectClass=javax.persistence.spi.PersistenceProvider;effective:=active;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider
        </capability>
    </feature>

    <feature name="my-infrastructure-requirements-jms" version="${project.version}">
<feature>aries-blueprint-spring</feature>
        <feature version="[4.2.2, 5)">shell-compat</feature>
        <feature version="[5.15.7, 6)">activemq-broker</feature>
        <feature version="[5.15.7, 6)">activemq-cf</feature>
        <feature version="[5.15.7, 6)">activemq-blueprint</feature>
<bundle>mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.camel/7.1.0-SNAPSHOT</bundle>
<bundle>mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/7.1.0-SNAPSHOT</bundle>

        <feature version="[4.2.2, 5)">jms</feature>
        <feature version="[2.23.0, 3)">camel</feature>
        <feature version="[2.23.0, 3)">camel-spring</feature>
        <feature version="[2.23.0, 3)">camel-jms</feature>
        <feature version="[2.23.0, 3)">camel-blueprint</feature>
        <feature version="[2.23.0, 3)">camel-cxf</feature>
        <feature version="[2.23.0, 3)">camel-jpa</feature>
        <feature version="[1.0.2, 2)">pax-jms-activemq</feature>
        <configfile finalname="/etc/org.apache.servicemix.activemq.service.cfg">
mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/${project.version}/cfg/activemq-service
        </configfile>
    </feature>
    <feature name="my-infrastructure-requirements-initial" version="${project.version}">
        <feature version="[4.2.2, 5)">scr</feature>
        <feature version="[4.2.2, 5)">jndi</feature>
        <feature version="[2.0.0, 3)">transaction</feature>
        <feature version="[1.0.0, 2)">pax-cdi</feature>
    </feature>

    <feature name="my-infrastructure-requirements-ext" version="${project.version}">         <feature version="${project.version}">my-infrastructure-requirements-spring-43</feature>
        <feature version="[1.3.0, 2)">pax-jdbc-config</feature>

        <feature version="[3.2.5, 4)">cxf-transports-jms</feature>
    </feature>

    <feature name="my-infrastructure-datasource" version="${project.version}">
<bundle>mvn:com.miroslav.my.infrastructure/data-source/${project.version}</bundle>
    </feature>

    <feature name="my-infrastructure-toolbox" version="${project.version}">
<bundle>mvn:com.miroslav.my.infrastructure/toolbox/${project.version}</bundle>
<bundle>mvn:com.miroslav.my.infrastructure/toolbox-shell-command/${project.version}</bundle>
    </feature>

    <feature name="my-infrastructure-webservice" version="${project.version}">
<bundle>mvn:com.miroslav.my.infrastructure.webservice/model/${project.version}</bundle>
<bundle>mvn:com.miroslav.my.infrastructure.webservice/toolbox/${project.version}</bundle>
    </feature>

    <feature name="my-infrastructure" version="${project.version}">
        <feature version="${project.version}">my-infrastructure-requirements-spring-43</feature>         <feature version="${project.version}">my-infrastructure-requirements-jpa</feature>         <feature version="${project.version}">my-infrastructure-requirements-cxf</feature>         <feature version="${project.version}">my-infrastructure-requirements-jms</feature>         <feature version="${project.version}">my-infrastructure-datasource</feature>         <feature version="${project.version}">my-infrastructure-toolbox</feature>         <feature version="${project.version}">my-infrastructure-webservice</feature>
    </feature>
</features>


If you need some more info, please let me know. ( this feature file is "a mess", as I did not know what is wrong ... so no need to judge it for its beauty please :D :D )

I am building ActiveMQ, Camel, Pax, Karaf, Hibernate ... SNAPSHOT versions daily and testing it.

Kind Regards,
Miroslav



--
Miroslav Beranič
MIBESIS
+386(0)40/814-843
[email protected] <mailto:[email protected]>
http://www.mibesis.si

Reply via email to