You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by oski_bear <da...@hotmail.com> on 2016/08/30 05:04:58 UTC

Karaf 4.0.5 prerequisite feature not installed with correct version

I'm having a hard time with feature installation in Karaf 4.0.5. The latest
issue seems to be that Karaf 4.0.5 disregards the version specified for a
prerequisite feature. E.g.

<features name="my-features-${project.version}"
xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
  <feature name="feature-a" version="${project.version}" description="Some
feature">
    <feature prerequisite="true"
version="3.2.14.RELEASE_1">spring-orm</feature>
    ...
  </feature>
</features>

After the container starts up I see that multiple versions of the spring
feature are installed instead of just the 3.2.14.RELEASE_1 version that I
specified. Seems like a bug.

Also I've noticed:
* The karaf-maven-plugin completely disregards the order specified in the
<bootFeatures> section of its configuration. E.g. try configuring the
<bootFeatures> section of the karaf-maven-plugin, build your custom
container, then scratch your head at the seemingly completely random order
of the boot features property in the org.apache.karaf.features.cfg file. Why
can't it just generate the file with the boot features in the same order I
specified in the plugin? Can I fix this? Is there a workaround?
* What's up with the seemingly random restarts of the container and the
endless stream of "The specified feature: blah version blah is already
installed" messages? Why does this happen? If it's normal or expected
behavior what's the point of these annoying messages? How can I prevent this
situation?
* Why is that sometimes when features fail to install the shell becomes
completely unresponsive?

I don't remember installing and defining features being this frustrating in
karaf 2.x.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by Guillaume Nodet <gn...@apache.org>.
I see, the documentation clearly needs to be fixed.
Though what I said about feature:install holds true, the behavior is
different afaik.

2016-09-02 2:14 GMT+02:00 oski_bear <da...@hotmail.com>:

> I'm sorry but that makes no sense. The documentation is in reference to
> defining a feature. Here it is again with a bit more of the preceding
> content.
>
> "
> It’s possible to define a version range for a dependent feature:
>
> <feature name="spring-dm">
>   <feature version="[2.5.6,4)">spring</feature>
>   ...
> </feature>
>
> The feature with the highest version available in the range will be
> installed.
>
> If a single version is specified, this version will be chosen.
>
> If nothing is specified, the highest available will be installed.
> "
>
> This pretty clearly seems to be referencing feature definition - not
> feature:install.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-
> tp4047753p4047827.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by oski_bear <da...@hotmail.com>.
I'm sorry but that makes no sense. The documentation is in reference to
defining a feature. Here it is again with a bit more of the preceding
content.

"
It’s possible to define a version range for a dependent feature:

<feature name="spring-dm">
  <feature version="[2.5.6,4)">spring</feature>
  ...
</feature>

The feature with the highest version available in the range will be
installed.

If a single version is specified, this version will be chosen.

If nothing is specified, the highest available will be installed.
"

This pretty clearly seems to be referencing feature definition - not
feature:install.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047827.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by Guillaume Nodet <gn...@apache.org>.
Well, in the case of the feature:install command, this is true, i.e. if a
single version specified will install this specific version.

2016-09-01 4:00 GMT+02:00 oski_bear <da...@hotmail.com>:

> FYI your  documentation <https://karaf.apache.org/
> manual/latest/provisioning>
> does not reflect this. Here's a direct quote:
>
> "
> The feature with the highest version available in the range will be
> installed.
>
> If a single version is specified, this version will be chosen.
>
> If nothing is specified, the highest available will be installed.
> "
>
> At the very least this is misleading.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-
> tp4047753p4047797.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by oski_bear <da...@hotmail.com>.
FYI your  documentation <https://karaf.apache.org/manual/latest/provisioning>  
does not reflect this. Here's a direct quote:

"
The feature with the highest version available in the range will be
installed.

If a single version is specified, this version will be chosen.

If nothing is specified, the highest available will be installed.
"

At the very least this is misleading.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047797.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by Markus Rathgeb <ma...@gmail.com>.
By the way: Also for Maven a version 1.0 generally means 1.0 or a
later version, if 1.0 is not available.
https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN402

2016-08-30 21:59 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
> By the way: it's the OSGi convention. The same apply to import package.
> Something like:
>
> Import-Package: com.foo;version="1.0.0"
>
> means [1.0.0,)
>
> If you want to narrow to 1.0.0 only then you have to use [1.0.0,1.0.0]
>
> Regards
> JB
>
>
> On 08/30/2016 09:24 PM, oski_bear wrote:
>>
>> Thanks Guillaume,
>>
>> The version range helped. Though, I think it's confusing that explicitly
>> setting a version translates to >=. After all I am using the "=" symbol
>> not
>> the ">=" symbol.
>>
>> I'm going to investigate the other issues a bit more and get back to you.
>>
>> Thanks again
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047761.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by oski_bear <da...@hotmail.com>.
I see. Well, I guess if it is the OSGi convention it makes sense. It's
surprising to me though. I've worked with OSGi and Karaf for years and I
always assumed that if you specified an exact version it would look only for
that version. Perhaps, because I've never had more than two versions of a
feature installed I just never realized this.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047764.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way: it's the OSGi convention. The same apply to import package. 
Something like:

Import-Package: com.foo;version="1.0.0"

means [1.0.0,)

If you want to narrow to 1.0.0 only then you have to use [1.0.0,1.0.0]

Regards
JB

On 08/30/2016 09:24 PM, oski_bear wrote:
> Thanks Guillaume,
>
> The version range helped. Though, I think it's confusing that explicitly
> setting a version translates to >=. After all I am using the "=" symbol not
> the ">=" symbol.
>
> I'm going to investigate the other issues a bit more and get back to you.
>
> Thanks again
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047761.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by oski_bear <da...@hotmail.com>.
Thanks Guillaume,

The version range helped. Though, I think it's confusing that explicitly
setting a version translates to >=. After all I am using the "=" symbol not
the ">=" symbol.

I'm going to investigate the other issues a bit more and get back to you.

Thanks again




--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-0-5-prerequisite-feature-not-installed-with-correct-version-tp4047753p4047761.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4.0.5 prerequisite feature not installed with correct version

Posted by Guillaume Nodet <gn...@apache.org>.
2016-08-30 7:04 GMT+02:00 oski_bear <da...@hotmail.com>:

> I'm having a hard time with feature installation in Karaf 4.0.5. The latest
> issue seems to be that Karaf 4.0.5 disregards the version specified for a
> prerequisite feature. E.g.
>
> <features name="my-features-${project.version}"
> xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
>   <feature name="feature-a" version="${project.version}" description="Some
> feature">
>     <feature prerequisite="true"
> version="3.2.14.RELEASE_1">spring-orm</feature>
>     ...
>   </feature>
> </features>
>
> After the container starts up I see that multiple versions of the spring
> feature are installed instead of just the 3.2.14.RELEASE_1 version that I
> specified. Seems like a bug.
>

There's a JIRA raised about that I've started investigating. I need to get
back to it.
Also, note that the version is a range, so when you specify version="xxx",
it means anything >= xxx.  You can use a closed range [xxx,xxx] if you need.


>
> Also I've noticed:
> * The karaf-maven-plugin completely disregards the order specified in the
> <bootFeatures> section of its configuration. E.g. try configuring the
> <bootFeatures> section of the karaf-maven-plugin, build your custom
> container, then scratch your head at the seemingly completely random order
> of the boot features property in the org.apache.karaf.features.cfg file.
> Why
> can't it just generate the file with the boot features in the same order I
> specified in the plugin? Can I fix this? Is there a workaround?
>

The reason for the loss is that the maven plugin computes the actual list
of bundles, Karaf using the osgi resolver, and the definition order is
currently lost.

You can use start levels on bundles or features to change the start order.


> * What's up with the seemingly random restarts of the container and the
> endless stream of "The specified feature: blah version blah is already
> installed" messages? Why does this happen? If it's normal or expected
> behavior what's the point of these annoying messages? How can I prevent
> this
> situation?
>

This message should only appear when you request a feature installation
and the feature was already installed.  If that does not seem to be the
case,
please raise a JIRA with steps to reproduce the problem.

* Why is that sometimes when features fail to install the shell becomes
> completely unresponsive?
>

That's definitely not expected. Can you raise a JIRA and explain the steps
to reproduce the problem ?


> I don't remember installing and defining features being this frustrating in
> karaf 2.x.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.
> com/Karaf-4-0-5-prerequisite-feature-not-installed-with-
> correct-version-tp4047753.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration

Email: gnodet@redhat.com
Web: http://fusesource.com
Blog: http://gnodet.blogspot.com/