You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by to...@quarendon.net on 2017/06/14 07:18:19 UTC

Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

I'm trying to build a custom karaf distribution using the maven karaf-assembly packaging type.

My latest issue is that the build fails with 

missing requirement osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

I interpret this as meaning the bundle uses DS and therefore I need apache.felix.scr.

If I don't add my bundle in, the build works, and when I start up the resulting karaf, feature:list shows that scr is installed and started. "bundle:headers mvn:org.apache.felix/org.apache.felix.scr/2.0.10" shows:

Provide-Capability =
        osgi.extender;uses:=org.osgi.service.component;osgi.extender=osgi.component;version:Version=1.3

So I appear to have that capability don't I? 

So why does the build apparently fail in that way?

My POM has:
   <dependencies>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <version>${karafVersion}</version>
            <type>kar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>${karafVersion}</version>
            <classifier>features</classifier>
            <type>xml</type>
			<scope>compile</scope>
        </dependency>

and then:

            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
				 <version>4.1.1</version>
				 <extensions>true</extensions>
                <configuration>
                    <installedFeatures>
                        <feature>wrapper</feature>
                    </installedFeatures>
                    <startupFeatures>
                        <feature>eventadmin</feature>
                    </startupFeatures>
                    <bootFeatures>
                        <feature>standard</feature>
                        <feature>webconsole</feature>
                        <feature>http-whiteboard</feature>
                        <feature>scr</feature>
                        <feature>prereqs</feature>
                    </bootFeatures>
                    <javase>1.8</javase>
                </configuration>
            </plugin>

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Tom,

also, how does your bnd "project" look like,
my gut feeling tells me right now, it might be because of duplicate bundles
installed via std. Karaf and bnd-tools,
may this be an issue?

regards, Achim


2017-06-14 10:08 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi,
>
> Can you share your sample project ?
>
> Thanks,
> Regards
> JB
>
>
> On 06/14/2017 09:18 AM, tom@quarendon.net wrote:
>
>> I'm trying to build a custom karaf distribution using the maven
>> karaf-assembly packaging type.
>>
>> My latest issue is that the build fails with
>>
>> missing requirement osgi.extender; filter:="(&(osgi.extender=osgi
>> .component)(version>=1.3.0)(!(version>=2.0.0)))"
>>
>> I interpret this as meaning the bundle uses DS and therefore I need
>> apache.felix.scr.
>>
>> If I don't add my bundle in, the build works, and when I start up the
>> resulting karaf, feature:list shows that scr is installed and started.
>> "bundle:headers mvn:org.apache.felix/org.apache.felix.scr/2.0.10" shows:
>>
>> Provide-Capability =
>>          osgi.extender;uses:=org.osgi.service.component;osgi.extende
>> r=osgi.component;version:Version=1.3
>>
>> So I appear to have that capability don't I?
>>
>> So why does the build apparently fail in that way?
>>
>> My POM has:
>>     <dependencies>
>>          <dependency>
>>              <groupId>org.apache.karaf.features</groupId>
>>              <artifactId>framework</artifactId>
>>              <version>${karafVersion}</version>
>>              <type>kar</type>
>>          </dependency>
>>          <dependency>
>>              <groupId>org.apache.karaf.features</groupId>
>>              <artifactId>standard</artifactId>
>>              <version>${karafVersion}</version>
>>              <classifier>features</classifier>
>>              <type>xml</type>
>>                         <scope>compile</scope>
>>          </dependency>
>>
>> and then:
>>
>>              <plugin>
>>                  <groupId>org.apache.karaf.tooling</groupId>
>>                  <artifactId>karaf-maven-plugin</artifactId>
>>                                  <version>4.1.1</version>
>>                                  <extensions>true</extensions>
>>                  <configuration>
>>                      <installedFeatures>
>>                          <feature>wrapper</feature>
>>                      </installedFeatures>
>>                      <startupFeatures>
>>                          <feature>eventadmin</feature>
>>                      </startupFeatures>
>>                      <bootFeatures>
>>                          <feature>standard</feature>
>>                          <feature>webconsole</feature>
>>                          <feature>http-whiteboard</feature>
>>                          <feature>scr</feature>
>>                          <feature>prereqs</feature>
>>                      </bootFeatures>
>>                      <javase>1.8</javase>
>>                  </configuration>
>>              </plugin>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
For sure, to validate your feature, it has to define scr as inner or dependency 
feature.

Regards
JB

On 06/14/2017 02:44 PM, tom@quarendon.net wrote:
> Oddly I can no longer reproduce the issue.
> 
> I thought it might have gone away because I'd added:
>     <feature>scr</feature>
> into my feature in the features.xml file. However I take that out again and it still works. Odd.
> 
> If I encounter it again, I'll reduce to a simple test case.
> 
>> On 14 June 2017 at 09:45 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>
>>
>> That would be great.
>>
>> In the mean time, I'm testing with the karaf-samples I prepared for the dev
>> guide update.
>>
>> Regards
>> JB
>>
>> On 06/14/2017 10:24 AM, tom@quarendon.net wrote:
>>>> Can you share your sample project ?
>>>
>>> I will try to put together a simple standalone test case. In fact I'll do that for something else as well that I can't get past.
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbonofre@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com

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

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by to...@quarendon.net.
Oddly I can no longer reproduce the issue.

I thought it might have gone away because I'd added:
   <feature>scr</feature>
into my feature in the features.xml file. However I take that out again and it still works. Odd.

If I encounter it again, I'll reduce to a simple test case.

> On 14 June 2017 at 09:45 Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> 
> 
> That would be great.
> 
> In the mean time, I'm testing with the karaf-samples I prepared for the dev 
> guide update.
> 
> Regards
> JB
> 
> On 06/14/2017 10:24 AM, tom@quarendon.net wrote:
> >> Can you share your sample project ?
> > 
> > I will try to put together a simple standalone test case. In fact I'll do that for something else as well that I can't get past.
> > 
> 
> -- 
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
That would be great.

In the mean time, I'm testing with the karaf-samples I prepared for the dev 
guide update.

Regards
JB

On 06/14/2017 10:24 AM, tom@quarendon.net wrote:
>> Can you share your sample project ?
> 
> I will try to put together a simple standalone test case. In fact I'll do that for something else as well that I can't get past.
> 

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

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by to...@quarendon.net.
> Can you share your sample project ?

I will try to put together a simple standalone test case. In fact I'll do that for something else as well that I can't get past.

Re: Why can I not satisfy "(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Can you share your sample project ?

Thanks,
Regards
JB

On 06/14/2017 09:18 AM, tom@quarendon.net wrote:
> I'm trying to build a custom karaf distribution using the maven karaf-assembly packaging type.
> 
> My latest issue is that the build fails with
> 
> missing requirement osgi.extender; filter:="(&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))"
> 
> I interpret this as meaning the bundle uses DS and therefore I need apache.felix.scr.
> 
> If I don't add my bundle in, the build works, and when I start up the resulting karaf, feature:list shows that scr is installed and started. "bundle:headers mvn:org.apache.felix/org.apache.felix.scr/2.0.10" shows:
> 
> Provide-Capability =
>          osgi.extender;uses:=org.osgi.service.component;osgi.extender=osgi.component;version:Version=1.3
> 
> So I appear to have that capability don't I?
> 
> So why does the build apparently fail in that way?
> 
> My POM has:
>     <dependencies>
>          <dependency>
>              <groupId>org.apache.karaf.features</groupId>
>              <artifactId>framework</artifactId>
>              <version>${karafVersion}</version>
>              <type>kar</type>
>          </dependency>
>          <dependency>
>              <groupId>org.apache.karaf.features</groupId>
>              <artifactId>standard</artifactId>
>              <version>${karafVersion}</version>
>              <classifier>features</classifier>
>              <type>xml</type>
> 			<scope>compile</scope>
>          </dependency>
> 
> and then:
> 
>              <plugin>
>                  <groupId>org.apache.karaf.tooling</groupId>
>                  <artifactId>karaf-maven-plugin</artifactId>
> 				 <version>4.1.1</version>
> 				 <extensions>true</extensions>
>                  <configuration>
>                      <installedFeatures>
>                          <feature>wrapper</feature>
>                      </installedFeatures>
>                      <startupFeatures>
>                          <feature>eventadmin</feature>
>                      </startupFeatures>
>                      <bootFeatures>
>                          <feature>standard</feature>
>                          <feature>webconsole</feature>
>                          <feature>http-whiteboard</feature>
>                          <feature>scr</feature>
>                          <feature>prereqs</feature>
>                      </bootFeatures>
>                      <javase>1.8</javase>
>                  </configuration>
>              </plugin>
> 

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