Thanks, JB:

Can you illustrate how to do this?
POMs don’t support version ranges, AFIK, and, as I wrote in another post, the 
missing feature is referenced by the Framework features.xml:

https://repo1.maven.org/maven2/org/apache/karaf/features/framework/4.3.1/framework-4.3.1-features.xml
 
<https://repo1.maven.org/maven2/org/apache/karaf/features/framework/4.3.1/framework-4.3.1-features.xml>

<bundle start-level="1">
mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.3.1
</bundle>


My only reference is to:

      <dependencies>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <type>kar</type>
            <scope>provided</scope>
            <version>${karaf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>provided</scope>
            <version>${karaf.version}</version>
        </dependency>
    </dependencies>

In my POM, and

        
<repository>mvn:org.apache.karaf.features/framework/${karaf.version}/xml/features</repository>




In my features.xml. 
An example will be helpful.   Thanks!

Best regards,
Alex soto




> On May 18, 2021, at 12:28 PM, JB Onofré <[email protected]> wrote:
> 
> Hi Alex
> 
> The resolver always take the latest release candidates. It was always like 
> this. If you use open version range it will take the latest one. 
> 
> For instance, as reminder, foo/bar/1.0 doesn’t mean only 1.0 but actually 
> [1.0,), so it will take the latest version. 
> 
> It’s also the case for the features repository. 
> 
> So if you don’t want the latest version you have to use [version,version] or 
> blacklist in etc/org.Apache.Karaf.features.xml. 
> 
> Regards 
> JB
> 
>> Le 18 mai 2021 à 20:18, Alex Soto <[email protected]> a écrit :
>> 
>> 
>> Hi JB,
>> 
>> I wonder how to tie the versions, apparently something changed in the 
>> resolver, where it is now picking up the latest released version of various 
>> artifacts, originally it was for wrap but I am now seeing it for others.  
>> Funny thing is, it was working before, but after version 4.3.2 was released, 
>> now it is failing.  
>> 
>> For example, now I am seeing it happening with the Framework.  Example:
>> 
>> 
>> Unable to resolve framework/4.3.1: missing requirement [framework/4.3.1] 
>> osgi.identity; osgi.identity=org.apache.karaf.features.extension; 
>> type=osgi.fragment; version="[4.3.1,4.3.1]"; resolution:=mandatory [caused 
>> by: Fragment was not selected for attachment: 
>> org.apache.karaf.features.extension [1](R 1.0)]
>>      at 
>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>      ... 12 more
>> Caused by: org.apache.felix.resolver.reason.ReasonException: Fragment was 
>> not selected for attachment: org.apache.karaf.features.extension [1](R 1.0)
>>      at 
>> org.apache.felix.resolver.Candidates$FragmentNotSelectedError.toException(Candidates.java:1305)
>>      ... 13 more
>> 
>> 
>> This is in the context of Custom Karaf distributions.  I see multiple 
>> versions being put in the system directory: 
>> 
>> $  ls -l system/org/apache/karaf/features/org.apache.karaf.features.extension
>> total 0
>> drwxr-xr-x. 2 vagrant vagrant 59 May 18 18:04 4.3.1
>> drwxr-xr-x. 2 vagrant vagrant 59 May 18 18:04 4.3.2
>> 
>> So it is pulling version 4.3.2, but I am only referencing 4.3.1 in my Maven 
>> POM:
>> 
>> <dependencies>
>>     <dependency>
>>       <groupId>org.apache.karaf.features</groupId>
>>       <artifactId>framework</artifactId>
>>       <version>4.3.1</version>
>>       <type>kar</type>
>>       <scope>provided</scope>
>>     </dependency>
>>     <dependency>
>>       <groupId>org.apache.karaf.features</groupId>
>>       <artifactId>standard</artifactId>
>>       <version>4.3.1</version>
>>       <type>xml</type>
>>       <classifier>features</classifier>
>>       <scope>provided</scope>
>>     </dependency>
>>   </dependencies>
>> 
>> 
>> Even though I am specifying the versions, the karaf-maven-plugin is still 
>> pulling the newest.  So, the question is, how to control the versions I 
>> want, and not be surprised by a future Karaf release?   
>> 
>> Best regards,
>> Alex soto
>> 
>> 
>> 
>> 
>>> On May 6, 2021, at 11:56 PM, Jean-Baptiste Onofre <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Hi Alex,
>>> 
>>> Yes, the version is not correct. I would check your feature / pom.xml, 
>>> maybe you don’t have version defined, so it takes the latest one.
>>> 
>>> Regards
>>> JB
>>> 
>>>> Le 6 mai 2021 à 18:56, Alex Soto <[email protected] 
>>>> <mailto:[email protected]>> a écrit :
>>>> 
>>>> 
>>>> I see…  
>>>> 
>>>> Karaf is looking for wrap version 2.6.7, but the version the  framework 
>>>> feature brings  is version is 2.6.2, so it does not find it.
>>>> However, I don’t know who is pulling version 2.6.7.  Will search for 
>>>> that...
>>>> 
>>>> Best regards,
>>>> Alex soto
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On May 6, 2021, at 10:15 AM, Alex Soto <[email protected] 
>>>>> <mailto:[email protected]>> wrote:
>>>>> 
>>>>> Thanks, JB, 
>>>>> 
>>>>> but I don’t understand.  When I inspect my 
>>>>> /etc/org.apache.karaf.features.cfg  file:
>>>>> 
>>>>> #
>>>>> # Comma separated list of features repositories to register by default
>>>>> #
>>>>> featuresRepositories = \
>>>>>     mvn:org.apache.karaf.features/standard/4.3.0/xml/features, \
>>>>>     mvn:org.apache.karaf.features/framework/4.3.0/xml/features, ...
>>>>> 
>>>>> #
>>>>> # Comma separated list of features to install at startup
>>>>> #
>>>>> featuresBoot = \
>>>>>     (wrap), \
>>>>>     package/4.3.1, \
>>>>>     log/4.3.1, \
>>>>>     ssh/4.3.1, \
>>>>>     framework/4.3.0, \
>>>>>     system/4.3.1, \
>>>>>   ...
>>>>> 
>>>>> 
>>>>> 
>>>>> The framework feature is there.
>>>>> 
>>>>> Also there is the jar:  
>>>>> /system/org/osgi/org.osgi.util.function/1.0.0/org.osgi.util.function-1.0.0.jar
>>>>>  
>>>>> 
>>>>> So, what do I need to do?
>>>>> 
>>>>> Best regards,
>>>>> Alex soto
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On May 6, 2021, at 9:59 AM, Jean-Baptiste Onofre <[email protected] 
>>>>>> <mailto:[email protected]>> wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> osgi.function is part of the framework feature:
>>>>>> 
>>>>>> https://github.com/apache/karaf/blob/main/assemblies/features/framework/src/main/feature/feature.xml#L34
>>>>>>  
>>>>>> <https://github.com/apache/karaf/blob/main/assemblies/features/framework/src/main/feature/feature.xml#L34>
>>>>>> 
>>>>>> That’s for Karaf 4.3.1/4.3.2.
>>>>>> 
>>>>>> For 4.3.0, it’s there but in version 1.0.0:
>>>>>> 
>>>>>> https://repo1.maven.org/maven2/org/apache/karaf/features/framework/4.3.0/framework-4.3.0-features.xml
>>>>>>  
>>>>>> <https://repo1.maven.org/maven2/org/apache/karaf/features/framework/4.3.0/framework-4.3.0-features.xml>
>>>>>> 
>>>>>> Regards
>>>>>> JB
>>>>>> 
>>>>>>> Le 6 mai 2021 à 17:36, Alex Soto <[email protected] 
>>>>>>> <mailto:[email protected]>> a écrit :
>>>>>>> 
>>>>>>> Hello,
>>>>>>> 
>>>>>>> Using a custom distribution, based on  Karaf version 4.3.0, I am 
>>>>>>> getting the following error, and Karaf would not start:
>>>>>>> 
>>>>>>> 
>>>>>>> $ bin/karaf 
>>>>>>> org.apache.felix.resolver.reason.ReasonException: Unable to resolve 
>>>>>>> root: missing requirement [root] osgi.identity; osgi.identity=wrap; 
>>>>>>> type=karaf.feature; version="[2.6.7,2.6.7]"; 
>>>>>>> filter:="(&(osgi.identity=wrap)(type=karaf.feature)(version>=2.6.7)(version<=2.6.7))"
>>>>>>>  [caused by: Unable to resolve wrap/2.6.7: missing requirement 
>>>>>>> [wrap/2.6.7] osgi.identity; osgi.identity=pax-url-wrap; 
>>>>>>> type=karaf.feature; version="[2.6.7,2.6.7]" [caused by: Unable to 
>>>>>>> resolve pax-url-wrap/2.6.7: missing requirement [pax-url-wrap/2.6.7] 
>>>>>>> osgi.identity; osgi.identity=org.ops4j.pax.url.wrap; type=osgi.bundle; 
>>>>>>> version="[2.6.7,2.6.7]"; resolution:=mandatory [caused by: Unable to 
>>>>>>> resolve org.ops4j.pax.url.wrap/2.6.7: missing requirement 
>>>>>>> [org.ops4j.pax.url.wrap/2.6.7] osgi.wiring.package; 
>>>>>>> filter:="(&(osgi.wiring.package=org.osgi.util.function)(version>=1.1.0)(!(version>=2.0.0)))"]]]
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:434)
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:421)
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375)
>>>>>>>         at 
>>>>>>> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
>>>>>>>         at 
>>>>>>> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:392)
>>>>>>>         at 
>>>>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
>>>>>>>         at 
>>>>>>> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
>>>>>>>         at 
>>>>>>> java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>>>>>>>         at 
>>>>>>> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>>>>>>>         at 
>>>>>>> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>>>>>>>         at java.base/java.lang.Thread.run(Thread.java:829)
>>>>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
>>>>>>> resolve wrap/2.6.7: missing requirement [wrap/2.6.7] osgi.identity; 
>>>>>>> osgi.identity=pax-url-wrap; type=karaf.feature; version="[2.6.7,2.6.7]" 
>>>>>>> [caused by: Unable to resolve pax-url-wrap/2.6.7: missing requirement 
>>>>>>> [pax-url-wrap/2.6.7] osgi.identity; 
>>>>>>> osgi.identity=org.ops4j.pax.url.wrap; type=osgi.bundle; 
>>>>>>> version="[2.6.7,2.6.7]"; resolution:=mandatory [caused by: Unable to 
>>>>>>> resolve org.ops4j.pax.url.wrap/2.6.7: missing requirement 
>>>>>>> [org.ops4j.pax.url.wrap/2.6.7] osgi.wiring.package; 
>>>>>>> filter:="(&(osgi.wiring.package=org.osgi.util.function)(version>=1.1.0)(!(version>=2.0.0)))"]]
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>>>>         ... 12 more
>>>>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
>>>>>>> resolve pax-url-wrap/2.6.7: missing requirement [pax-url-wrap/2.6.7] 
>>>>>>> osgi.identity; osgi.identity=org.ops4j.pax.url.wrap; type=osgi.bundle; 
>>>>>>> version="[2.6.7,2.6.7]"; resolution:=mandatory [caused by: Unable to 
>>>>>>> resolve org.ops4j.pax.url.wrap/2.6.7: missing requirement 
>>>>>>> [org.ops4j.pax.url.wrap/2.6.7] osgi.wiring.package; 
>>>>>>> filter:="(&(osgi.wiring.package=org.osgi.util.function)(version>=1.1.0)(!(version>=2.0.0)))"]
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>>>>         ... 13 more
>>>>>>> Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to 
>>>>>>> resolve org.ops4j.pax.url.wrap/2.6.7: missing requirement 
>>>>>>> [org.ops4j.pax.url.wrap/2.6.7] osgi.wiring.package; 
>>>>>>> filter:="(&(osgi.wiring.package=org.osgi.util.function)(version>=1.1.0)(!(version>=2.0.0)))"
>>>>>>>         at 
>>>>>>> org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
>>>>>>>         ... 14 more
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Java version is:  openjdk version "11.0.11" 2021-04-20 LTS
>>>>>>> OS:  Linux version 3.10.0-1127.el7.x86_64 
>>>>>>> ([email protected] 
>>>>>>> <mailto:[email protected]>) (gcc version 4.8.5 
>>>>>>> 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020
>>>>>>> 
>>>>>>> 
>>>>>>> I have verified the required jar is present:
>>>>>>> 
>>>>>>> $ ls -l system/org/osgi/org.osgi.util.function/1.1.0/
>>>>>>> total 16
>>>>>>> -rw-r--r--. 1 vagrant vagrant 14053 May  6 14:49 
>>>>>>> org.osgi.util.function-1.1.0.jar
>>>>>>> 
>>>>>>> 
>>>>>>> Any help will be appreciated. 
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Alex soto
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 

Reply via email to