You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Miroslav Beranič <mi...@mibesis.si> on 2018/09/05 07:42:04 UTC

Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )

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
miroslav.beranic@mibesis.si
http://www.mibesis.si

Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )

Posted by Miroslav Beranič <mi...@mibesis.si>.
Hi JB,

thanks for the tip. So, another strange thing is:

- when this block occures - feature fail to install, no other feature is
possible to install, even some basic/simple one.

Please see attachment, full log of what I did.
In short ( last few lines ):

.
.
.
Done.
karaf@root()> feature:install -v my-infrastructure-requirements-jms ( this
is same as in previous feature definition )
Adding features: my-infrastructure-requirements-jms/[2.0.0,2.0.0]
^C~ # Fail here - waiting, but no return
karaf@root()> feature:info my-infrastructure-requirements-jms
Feature my-infrastructure-requirements-jms 2.0.0
Feature has no configuration
Feature configuration files:
  /etc/org.apache.servicemix.activemq.service.cfg
Feature depends on:
  aries-blueprint-spring 0.0.0
  shell-compat [4.2.2, 5)
  activemq-broker [5.15.7, 6)
  activemq-cf [5.15.7, 6)
  activemq-blueprint [5.15.7, 6)
  jms [4.2.2, 5)
  camel [2.23.0, 3)
  camel-spring [2.23.0, 3)
  camel-jms [2.23.0, 3)
  camel-blueprint [2.23.0, 3)
  camel-cxf [2.23.0, 3)
  camel-jpa [2.23.0, 3)
  pax-jms-activemq [1.0.2, 2)
Feature contains followed bundles:

mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.camel/7.1.0-SNAPSHOT

mvn:org.apache.servicemix.activemq/org.apache.servicemix.activemq.service/7.1.0-SNAPSHOT
Feature has no conditionals.
karaf@root()> feature:install aries-blueprint-spring
^C~ # Fail here - after first waiting and no return, no additional feature
is possible to install
karaf@root()>

So I am able to "block" Karaf from installing additional features with
this, and this is not so nice "feature" to have in Karaf :)  ( to be able
to block feature install )


Kind Regards,
Miroslav






V V sre., 5. sep. 2018 ob 10:36 je oseba Jean-Baptiste Onofré <
jb@nanthrax.net> napisala:

> You should use feature:install -v -t to get details and simulation.
>
> Regards
> JB
>
> On 05/09/2018 10:34, Miroslav Beranič wrote:
>
> HI JB,
>
> this can be, I would have to check for each feature, but as said: when
> porting from Karaf 4.0.9 to 4.2.2, I guess this would have to be addressed
> more verbose -- some kind of warning message or something.
>
> I will re-create feature file with suggested changes, but I stopped using
> dependency/prerequisite attributes, as I found out I ran into different set
> of problems.
>
> I had this kind of problems, when setting up JPA datasource - as conumers
> complaint to on start on missing datasource - but bundles installed and
> started.
>
> It is "strange" when command "feature:install foo" does not return to
> terminal and there is no message in log file.
>
> Thanks, kind regards,
> Miroslav
>
>
>
> V V sre., 5. sep. 2018 ob 10:08 je oseba Jean-Baptiste Onofré <
> jb@nanthrax.net> napisala:
>
>> 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
>> miroslav.beranic@mibesis.si
>> http://www.mibesis.si
>>
>>
>>
>
> --
> Miroslav Beranič
> MIBESIS
> +386(0)40/814-843
> miroslav.beranic@mibesis.si
> http://www.mibesis.si
>
>
>

-- 
Miroslav Beranič
MIBESIS
+386(0)40/814-843
miroslav.beranic@mibesis.si
http://www.mibesis.si

Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
You should use feature:install -v -t to get details and simulation.

Regards
JB


On 05/09/2018 10:34, Miroslav Beranič wrote:
> HI JB,
>
> this can be, I would have to check for each feature, but as said: when 
> porting from Karaf 4.0.9 to 4.2.2, I guess this would have to be 
> addressed more verbose -- some kind of warning message or something.
>
> I will re-create feature file with suggested changes, but I stopped 
> using dependency/prerequisite attributes, as I found out I ran into 
> different set of problems.
>
> I had this kind of problems, when setting up JPA datasource - as 
> conumers complaint to on start on missing datasource - but bundles 
> installed and started.
>
> It is "strange" when command "feature:install foo" does not return to 
> terminal and there is no message in log file.
>
> Thanks, kind regards,
> Miroslav
>
>
>
> V V sre., 5. sep. 2018 ob 10:08 je oseba Jean-Baptiste Onofré 
> <jb@nanthrax.net <ma...@nanthrax.net>> napisala:
>
>     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
>>     miroslav.beranic@mibesis.si <ma...@mibesis.si>
>>     http://www.mibesis.si
>
>
>
> -- 
> Miroslav Beranič
> MIBESIS
> +386(0)40/814-843
> miroslav.beranic@mibesis.si <ma...@mibesis.si>
> http://www.mibesis.si


Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )

Posted by Miroslav Beranič <mi...@mibesis.si>.
HI JB,

this can be, I would have to check for each feature, but as said: when
porting from Karaf 4.0.9 to 4.2.2, I guess this would have to be addressed
more verbose -- some kind of warning message or something.

I will re-create feature file with suggested changes, but I stopped using
dependency/prerequisite attributes, as I found out I ran into different set
of problems.

I had this kind of problems, when setting up JPA datasource - as conumers
complaint to on start on missing datasource - but bundles installed and
started.

It is "strange" when command "feature:install foo" does not return to
terminal and there is no message in log file.

Thanks, kind regards,
Miroslav



V V sre., 5. sep. 2018 ob 10:08 je oseba Jean-Baptiste Onofré <
jb@nanthrax.net> napisala:

> 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
> miroslav.beranic@mibesis.si
> http://www.mibesis.si
>
>
>

-- 
Miroslav Beranič
MIBESIS
+386(0)40/814-843
miroslav.beranic@mibesis.si
http://www.mibesis.si

Re: Karaf 4.2.1, 4.2.2 ( build from Git ) - Feature install blocked - condition race ( ? )

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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
> miroslav.beranic@mibesis.si <ma...@mibesis.si>
> http://www.mibesis.si