You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sriharsha <Sr...@mindtree.com> on 2008/12/02 19:23:43 UTC

Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

I am downloading spring - osgi jars from following repository,

http://www.springsource.com/repository/app/

I have currently downloaded following jars.

com.springsource.org.apache.commons.logging-1.1.1.jar
spring.jar
backport-util-concurrent-3.1.jar
spring-osgi-core-1.1.0.jar
spring-osgi-extender-1.1.0.jar
spring-osgi-io-1.1.0.jar

  The problem I am facing is that all the above jars have version specific
import packages, 
in which many of them specified version ranges in Import/Export package. 
(Example: Import-Package: org.aopalliance.aop;version="[1.0.0, 2.0.0)" )
  I am using bindex to generate repository.xml, and when I try to add this
repository.xml URL to
felix using 

	obr add-url myrepo/repository.xml

then I am getting following exception.

 	org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<= 
 	
So can u plz provide me with the hack of the bindex tool so that i can use
the generated repository xml
in the correct format mentioned in the thread above.


Stuart McCulloch wrote:
> 
> 2008/11/17 Sriharsha <Sr...@mindtree.com>
> 
>>
>> I am facing an issue with package level version with bindex and OBR,
>> previously I was using required bundle, now I am writing dependencies on
>> packages,
>>
>> Problem is ,
>>
>> Bundle1 requires a packages called com.foo (version range from 1.0 to
>> 2.0),
>> where in the package com.foo is exported by bundles Bundle2,version-1.1
>> and
>> Bundle3,version-1.0 respectively.
>>
>> Manifest of Bundle1 looks like ;
>>
>> Manifest-Version: 1.0
>> Bundle-Name: Bundle1
>> Bundle-Activator: com.abc.consumer.ConsumerActivator
>> Import-Package: org.osgi.framework, com.foo;version="[1.0,2.0)"
>> Bundle-ManifestVersion: 2
>> Bundle-SymbolicName: Bundle1
>> Bundle-Version: 1.0.0
>>
>> then the generated repository.xml have the following content,
>>
>> <resource id='Bundle1/1.0.0' presentationname='Bundle1'
>> symbolicname='Bundle1' uri='bundles/Bundle1/1.0.0/Bundle1_1.0.0.jar'
>> version='1.0.0'>
>>    <size>
>>      1709
>>    </size>
>>    <capability name='bundle'>
>>      <p n='manifestversion' v='2'/>
>>      <p n='presentationname' v='Bundle1'/>
>>      <p n='symbolicname' v='Bundle1'/>
>>      <p n='version' t='version' v='1.0.0'/>
>>    </capability>
>> <require extend='false'
>> filter='(&amp;(package=com.foo)(version&gt;=1.0.0)(version&lt;2.0.0))'
>> multiple='false' name='package' optional='false'>
>>       Import package com.foo;version=[1.0.0,2.0.0)
>>    </require>
>>    <require extend='false'
>> filter='(&(package=org.osgi.framework)(version>=0.0.0))' multiple='false'
>> name='package' optional='false'>
>>      Import package org.osgi.framework
>>    </require>
>> </resource>
>>
>>
>> But when i try to deploy Bundle1 then I am getting the following
>> exception,
>>
>>         org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>>
>> Please suggest a way to come out of this exception, or correct me if
>> something is wrong in the above manifest.
>>
> 
> the problem is because the Felix bundlerepository re-uses the framework
> LDAP filter implementation rather than implementing its own filter+parser
> 
>   http://issues.apache.org/jira/browse/FELIX-759
> 
> the OBR RFC states that the OBR filter should accept < and > operators,
> but these are not currently supported by the Felix framework filter
> because
> the R4 specification did not originally include them as permitted
> operators
> 
> so basically, it's a mismatch between the OBR and framework filter specs
> 
> another workaround would be to patch bindex (et. al) to avoid using these
> operators, but this would be a hack because the OBR spec clearly allows
> both < and >, it's just the Felix bundlerepository that doesn't like them
> 
> Thanks in advance,
>> Sriharsha.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20537950.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 
> -- 
> Cheers, Stuart
> 
> 


-----
Sriharsha

-- 
View this message in context: http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20798030.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by Karl Pauls <ka...@gmail.com>.
Can you give us a concrete example?

regards,

Karl

On Wed, Dec 3, 2008 at 2:45 PM, Peter Kriens <pe...@aqute.biz> wrote:
> I have modified the bindex sources to now generate proper OSGi filter
> expressions for version ranges. However, it still generates OBR Filter
> syntax for mandatory attributes.
>
> The problem with mandatory attrs is, is that you must verify that all values
> for the mandatory: attribute are present in the set of names.
>
>        properties
>        mandatory: = [ a,b,c]
>
>        All attribute names are: a,b,c,d
>
> Currently I generate
>
>        (mandatory:<*a,b,c,d)
>
> Which verifies that all properties for mandatory: are in the filter value
> part. If I could find a way to write this as a normal filter, then I would
> be saved.
>
> Kind regards,
>
>        Peter Kriens
>
>
> Kind regards,
>
>        Peter Kriens
>
> On 2 dec 2008, at 19:23, Sriharsha wrote:
>
>>
>> I am downloading spring - osgi jars from following repository,
>>
>> http://www.springsource.com/repository/app/
>>
>> I have currently downloaded following jars.
>>
>> com.springsource.org.apache.commons.logging-1.1.1.jar
>> spring.jar
>> backport-util-concurrent-3.1.jar
>> spring-osgi-core-1.1.0.jar
>> spring-osgi-extender-1.1.0.jar
>> spring-osgi-io-1.1.0.jar
>>
>>  The problem I am facing is that all the above jars have version specific
>> import packages,
>> in which many of them specified version ranges in Import/Export package.
>> (Example: Import-Package: org.aopalliance.aop;version="[1.0.0, 2.0.0)" )
>>  I am using bindex to generate repository.xml, and when I try to add this
>> repository.xml URL to
>> felix using
>>
>>        obr add-url myrepo/repository.xml
>>
>> then I am getting following exception.
>>
>>        org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>>
>> So can u plz provide me with the hack of the bindex tool so that i can use
>> the generated repository xml
>> in the correct format mentioned in the thread above.
>>
>>
>> Stuart McCulloch wrote:
>>>
>>> 2008/11/17 Sriharsha <Sr...@mindtree.com>
>>>
>>>>
>>>> I am facing an issue with package level version with bindex and OBR,
>>>> previously I was using required bundle, now I am writing dependencies on
>>>> packages,
>>>>
>>>> Problem is ,
>>>>
>>>> Bundle1 requires a packages called com.foo (version range from 1.0 to
>>>> 2.0),
>>>> where in the package com.foo is exported by bundles Bundle2,version-1.1
>>>> and
>>>> Bundle3,version-1.0 respectively.
>>>>
>>>> Manifest of Bundle1 looks like ;
>>>>
>>>> Manifest-Version: 1.0
>>>> Bundle-Name: Bundle1
>>>> Bundle-Activator: com.abc.consumer.ConsumerActivator
>>>> Import-Package: org.osgi.framework, com.foo;version="[1.0,2.0)"
>>>> Bundle-ManifestVersion: 2
>>>> Bundle-SymbolicName: Bundle1
>>>> Bundle-Version: 1.0.0
>>>>
>>>> then the generated repository.xml have the following content,
>>>>
>>>> <resource id='Bundle1/1.0.0' presentationname='Bundle1'
>>>> symbolicname='Bundle1' uri='bundles/Bundle1/1.0.0/Bundle1_1.0.0.jar'
>>>> version='1.0.0'>
>>>>  <size>
>>>>    1709
>>>>  </size>
>>>>  <capability name='bundle'>
>>>>    <p n='manifestversion' v='2'/>
>>>>    <p n='presentationname' v='Bundle1'/>
>>>>    <p n='symbolicname' v='Bundle1'/>
>>>>    <p n='version' t='version' v='1.0.0'/>
>>>>  </capability>
>>>> <require extend='false'
>>>> filter='(&amp;(package=com.foo)(version&gt;=1.0.0)(version&lt;2.0.0))'
>>>> multiple='false' name='package' optional='false'>
>>>>     Import package com.foo;version=[1.0.0,2.0.0)
>>>>  </require>
>>>>  <require extend='false'
>>>> filter='(&(package=org.osgi.framework)(version>=0.0.0))'
>>>> multiple='false'
>>>> name='package' optional='false'>
>>>>    Import package org.osgi.framework
>>>>  </require>
>>>> </resource>
>>>>
>>>>
>>>> But when i try to deploy Bundle1 then I am getting the following
>>>> exception,
>>>>
>>>>       org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>>>>
>>>> Please suggest a way to come out of this exception, or correct me if
>>>> something is wrong in the above manifest.
>>>>
>>>
>>> the problem is because the Felix bundlerepository re-uses the framework
>>> LDAP filter implementation rather than implementing its own filter+parser
>>>
>>>  http://issues.apache.org/jira/browse/FELIX-759
>>>
>>> the OBR RFC states that the OBR filter should accept < and > operators,
>>> but these are not currently supported by the Felix framework filter
>>> because
>>> the R4 specification did not originally include them as permitted
>>> operators
>>>
>>> so basically, it's a mismatch between the OBR and framework filter specs
>>>
>>> another workaround would be to patch bindex (et. al) to avoid using these
>>> operators, but this would be a hack because the OBR spec clearly allows
>>> both < and >, it's just the Felix bundlerepository that doesn't like them
>>>
>>> Thanks in advance,
>>>>
>>>> Sriharsha.
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>>
>>>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20537950.html
>>>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Cheers, Stuart
>>>
>>>
>>
>>
>> -----
>> Sriharsha
>>
>> --
>> View this message in context:
>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20798030.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by Peter Kriens <pe...@aqute.biz>.
There is also an SVN project, see the end of http://www.osgi.org/Repository/BIndex

Kind regards,

	Peter Kriens

On 11 dec 2008, at 14:41, Richard S. Hall wrote:

> Typically, Peter distributes the source code of his projects right  
> in the JAR file itself in the OSGI-OPT directory.
>
> -> richard
>
> Sriharsha wrote:
>> Can you please provide us the latest source code of bindex(the one  
>> with the
>> above fix)?
>>
>> Also, when our repository contains even 1 jar which is not in  
>> bundle'ized
>> format, the generated repository.xml is not accepted by OBR.
>> One way to ensure this, is we never put a non bundle'ized jar in the
>> repository, but if accidentally somebody puts one (after all it is  
>> just a
>> file system), it becomes impossible to debug. So we are trying  to  
>> parse the
>> generated repository.xml file and remove all the resource ids with
>> id=Untitled.
>>
>> <resource id="Untitled--2050119365/0.0.0"
>> symbolicname="Untitled--2050119365"
>> uri="com/sun/facelets/jsf-facelets/1.1.11/jsf-facelets-1.1.11.jar"
>> version="0.0.0">
>>    <size>
>>      291366
>>    </size>
>>    <capability name="bundle">
>>      <p n="manifestversion" v="1"/>
>>      <p n="symbolicname" v="Untitled--2050119365"/>
>>      <p n="version" t="version" v="0.0.0"/>
>>    </capability>
>>  </resource>
>>
>> However it is better, if you can provide a hack of not generating the
>> resource id for jars not in bundle format.
>>  your suggestion?
>>
>> -----
>> Sriharsha
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Typically, Peter distributes the source code of his projects right in 
the JAR file itself in the OSGI-OPT directory.

-> richard

Sriharsha wrote:
>  Can you please provide us the latest source code of bindex(the one with the
> above fix)?
>
> Also, when our repository contains even 1 jar which is not in bundle'ized
> format, the generated repository.xml is not accepted by OBR. 
>
> One way to ensure this, is we never put a non bundle'ized jar in the
> repository, but if accidentally somebody puts one (after all it is just a
> file system), it becomes impossible to debug. So we are trying  to parse the
> generated repository.xml file and remove all the resource ids with
> id=Untitled.
>
>  <resource id="Untitled--2050119365/0.0.0"
> symbolicname="Untitled--2050119365"
> uri="com/sun/facelets/jsf-facelets/1.1.11/jsf-facelets-1.1.11.jar"
> version="0.0.0">
>     <size>
>       291366
>     </size>
>     <capability name="bundle">
>       <p n="manifestversion" v="1"/>
>       <p n="symbolicname" v="Untitled--2050119365"/>
>       <p n="version" t="version" v="0.0.0"/>
>     </capability>
>   </resource>
>
> However it is better, if you can provide a hack of not generating the
> resource id for jars not in bundle format.
>   your suggestion?
>
> -----
> Sriharsha
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by Sriharsha <Sr...@mindtree.com>.
 Can you please provide us the latest source code of bindex(the one with the
above fix)?

Also, when our repository contains even 1 jar which is not in bundle'ized
format, the generated repository.xml is not accepted by OBR. 

One way to ensure this, is we never put a non bundle'ized jar in the
repository, but if accidentally somebody puts one (after all it is just a
file system), it becomes impossible to debug. So we are trying  to parse the
generated repository.xml file and remove all the resource ids with
id=Untitled.

 <resource id="Untitled--2050119365/0.0.0"
symbolicname="Untitled--2050119365"
uri="com/sun/facelets/jsf-facelets/1.1.11/jsf-facelets-1.1.11.jar"
version="0.0.0">
    <size>
      291366
    </size>
    <capability name="bundle">
      <p n="manifestversion" v="1"/>
      <p n="symbolicname" v="Untitled--2050119365"/>
      <p n="version" t="version" v="0.0.0"/>
    </capability>
  </resource>

However it is better, if you can provide a hack of not generating the
resource id for jars not in bundle format.
  your suggestion?

-----
Sriharsha

-- 
View this message in context: http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20953668.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by Sriharsha <Sr...@mindtree.com>.
I tried removing all (mandatory:<*a,b,c,d) portions from my repository.xml
and I was able to add the repository url through OBR. Else I get the same
error. 
[Note: I tried with spring bundle available in
http://www.springsource.com/repository/app/
by removing mandatory tag from generated repository.xml]
Does that mean that I will have to parse through the generated
repository.xml and delete all (mandatory:<*a,b,c,d) tags to make it a valid
repository.xml for OBR.
Or can you give a hack that this (mandatory:<*a,b,c,d) wont get created at
all?
Or is it ideal that a hack has to be made in Felix OBR to ignore the syntax?

Thanks,
Sriharsha


pkriens wrote:
> 
> I have modified the bindex sources to now generate proper OSGi filter  
> expressions for version ranges. However, it still generates OBR Filter  
> syntax for mandatory attributes.
> 
> The problem with mandatory attrs is, is that you must verify that all  
> values for the mandatory: attribute are present in the set of names.
> 
> 	properties
> 	mandatory: = [ a,b,c]
> 
> 	All attribute names are: a,b,c,d
> 
> Currently I generate
> 
> 	(mandatory:<*a,b,c,d)
> 
> Which verifies that all properties for mandatory: are in the filter  
> value part. If I could find a way to write this as a normal filter,  
> then I would be saved.
> 
> Kind regards,
> 
> 	Peter Kriens
> 
> 	
> Kind regards,
> 
> 	Peter Kriens
> 
> On 2 dec 2008, at 19:23, Sriharsha wrote:
> 
>>
>> I am downloading spring - osgi jars from following repository,
>>
>> http://www.springsource.com/repository/app/
>>
>> I have currently downloaded following jars.
>>
>> com.springsource.org.apache.commons.logging-1.1.1.jar
>> spring.jar
>> backport-util-concurrent-3.1.jar
>> spring-osgi-core-1.1.0.jar
>> spring-osgi-extender-1.1.0.jar
>> spring-osgi-io-1.1.0.jar
>>
>>  The problem I am facing is that all the above jars have version  
>> specific
>> import packages,
>> in which many of them specified version ranges in Import/Export  
>> package.
>> (Example: Import-Package: org.aopalliance.aop;version="[1.0.0,  
>> 2.0.0)" )
>>  I am using bindex to generate repository.xml, and when I try to add  
>> this
>> repository.xml URL to
>> felix using
>>
>> 	obr add-url myrepo/repository.xml
>>
>> then I am getting following exception.
>>
>> 	org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>> 	
>> So can u plz provide me with the hack of the bindex tool so that i  
>> can use
>> the generated repository xml
>> in the correct format mentioned in the thread above.
>>
>>
>> Stuart McCulloch wrote:
>>>
>>> 2008/11/17 Sriharsha <Sr...@mindtree.com>
>>>
>>>>
>>>> I am facing an issue with package level version with bindex and OBR,
>>>> previously I was using required bundle, now I am writing  
>>>> dependencies on
>>>> packages,
>>>>
>>>> Problem is ,
>>>>
>>>> Bundle1 requires a packages called com.foo (version range from 1.0  
>>>> to
>>>> 2.0),
>>>> where in the package com.foo is exported by bundles  
>>>> Bundle2,version-1.1
>>>> and
>>>> Bundle3,version-1.0 respectively.
>>>>
>>>> Manifest of Bundle1 looks like ;
>>>>
>>>> Manifest-Version: 1.0
>>>> Bundle-Name: Bundle1
>>>> Bundle-Activator: com.abc.consumer.ConsumerActivator
>>>> Import-Package: org.osgi.framework, com.foo;version="[1.0,2.0)"
>>>> Bundle-ManifestVersion: 2
>>>> Bundle-SymbolicName: Bundle1
>>>> Bundle-Version: 1.0.0
>>>>
>>>> then the generated repository.xml have the following content,
>>>>
>>>> <resource id='Bundle1/1.0.0' presentationname='Bundle1'
>>>> symbolicname='Bundle1' uri='bundles/Bundle1/1.0.0/Bundle1_1.0.0.jar'
>>>> version='1.0.0'>
>>>>   <size>
>>>>     1709
>>>>   </size>
>>>>   <capability name='bundle'>
>>>>     <p n='manifestversion' v='2'/>
>>>>     <p n='presentationname' v='Bundle1'/>
>>>>     <p n='symbolicname' v='Bundle1'/>
>>>>     <p n='version' t='version' v='1.0.0'/>
>>>>   </capability>
>>>> <require extend='false'
>>>> filter='(&amp;(package=com.foo)(version&gt;=1.0.0)(version&lt; 
>>>> 2.0.0))'
>>>> multiple='false' name='package' optional='false'>
>>>>      Import package com.foo;version=[1.0.0,2.0.0)
>>>>   </require>
>>>>   <require extend='false'
>>>> filter='(&(package=org.osgi.framework)(version>=0.0.0))'  
>>>> multiple='false'
>>>> name='package' optional='false'>
>>>>     Import package org.osgi.framework
>>>>   </require>
>>>> </resource>
>>>>
>>>>
>>>> But when i try to deploy Bundle1 then I am getting the following
>>>> exception,
>>>>
>>>>        org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>>>>
>>>> Please suggest a way to come out of this exception, or correct me if
>>>> something is wrong in the above manifest.
>>>>
>>>
>>> the problem is because the Felix bundlerepository re-uses the  
>>> framework
>>> LDAP filter implementation rather than implementing its own filter 
>>> +parser
>>>
>>>  http://issues.apache.org/jira/browse/FELIX-759
>>>
>>> the OBR RFC states that the OBR filter should accept < and >  
>>> operators,
>>> but these are not currently supported by the Felix framework filter
>>> because
>>> the R4 specification did not originally include them as permitted
>>> operators
>>>
>>> so basically, it's a mismatch between the OBR and framework filter  
>>> specs
>>>
>>> another workaround would be to patch bindex (et. al) to avoid using  
>>> these
>>> operators, but this would be a hack because the OBR spec clearly  
>>> allows
>>> both < and >, it's just the Felix bundlerepository that doesn't  
>>> like them
>>>
>>> Thanks in advance,
>>>> Sriharsha.
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20537950.html
>>>> Sent from the Apache Felix - Users mailing list archive at  
>>>> Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Cheers, Stuart
>>>
>>>
>>
>>
>> -----
>> Sriharsha
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20798030.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
> 


-----
Sriharsha

-- 
View this message in context: http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20847451.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: bindex tool is unable to retain the Require-Bundle/bundle-version info in the repository.xml

Posted by Peter Kriens <pe...@aqute.biz>.
I have modified the bindex sources to now generate proper OSGi filter  
expressions for version ranges. However, it still generates OBR Filter  
syntax for mandatory attributes.

The problem with mandatory attrs is, is that you must verify that all  
values for the mandatory: attribute are present in the set of names.

	properties
	mandatory: = [ a,b,c]

	All attribute names are: a,b,c,d

Currently I generate

	(mandatory:<*a,b,c,d)

Which verifies that all properties for mandatory: are in the filter  
value part. If I could find a way to write this as a normal filter,  
then I would be saved.

Kind regards,

	Peter Kriens

	
Kind regards,

	Peter Kriens

On 2 dec 2008, at 19:23, Sriharsha wrote:

>
> I am downloading spring - osgi jars from following repository,
>
> http://www.springsource.com/repository/app/
>
> I have currently downloaded following jars.
>
> com.springsource.org.apache.commons.logging-1.1.1.jar
> spring.jar
> backport-util-concurrent-3.1.jar
> spring-osgi-core-1.1.0.jar
> spring-osgi-extender-1.1.0.jar
> spring-osgi-io-1.1.0.jar
>
>  The problem I am facing is that all the above jars have version  
> specific
> import packages,
> in which many of them specified version ranges in Import/Export  
> package.
> (Example: Import-Package: org.aopalliance.aop;version="[1.0.0,  
> 2.0.0)" )
>  I am using bindex to generate repository.xml, and when I try to add  
> this
> repository.xml URL to
> felix using
>
> 	obr add-url myrepo/repository.xml
>
> then I am getting following exception.
>
> 	org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
> 	
> So can u plz provide me with the hack of the bindex tool so that i  
> can use
> the generated repository xml
> in the correct format mentioned in the thread above.
>
>
> Stuart McCulloch wrote:
>>
>> 2008/11/17 Sriharsha <Sr...@mindtree.com>
>>
>>>
>>> I am facing an issue with package level version with bindex and OBR,
>>> previously I was using required bundle, now I am writing  
>>> dependencies on
>>> packages,
>>>
>>> Problem is ,
>>>
>>> Bundle1 requires a packages called com.foo (version range from 1.0  
>>> to
>>> 2.0),
>>> where in the package com.foo is exported by bundles  
>>> Bundle2,version-1.1
>>> and
>>> Bundle3,version-1.0 respectively.
>>>
>>> Manifest of Bundle1 looks like ;
>>>
>>> Manifest-Version: 1.0
>>> Bundle-Name: Bundle1
>>> Bundle-Activator: com.abc.consumer.ConsumerActivator
>>> Import-Package: org.osgi.framework, com.foo;version="[1.0,2.0)"
>>> Bundle-ManifestVersion: 2
>>> Bundle-SymbolicName: Bundle1
>>> Bundle-Version: 1.0.0
>>>
>>> then the generated repository.xml have the following content,
>>>
>>> <resource id='Bundle1/1.0.0' presentationname='Bundle1'
>>> symbolicname='Bundle1' uri='bundles/Bundle1/1.0.0/Bundle1_1.0.0.jar'
>>> version='1.0.0'>
>>>   <size>
>>>     1709
>>>   </size>
>>>   <capability name='bundle'>
>>>     <p n='manifestversion' v='2'/>
>>>     <p n='presentationname' v='Bundle1'/>
>>>     <p n='symbolicname' v='Bundle1'/>
>>>     <p n='version' t='version' v='1.0.0'/>
>>>   </capability>
>>> <require extend='false'
>>> filter='(&amp;(package=com.foo)(version&gt;=1.0.0)(version&lt; 
>>> 2.0.0))'
>>> multiple='false' name='package' optional='false'>
>>>      Import package com.foo;version=[1.0.0,2.0.0)
>>>   </require>
>>>   <require extend='false'
>>> filter='(&(package=org.osgi.framework)(version>=0.0.0))'  
>>> multiple='false'
>>> name='package' optional='false'>
>>>     Import package org.osgi.framework
>>>   </require>
>>> </resource>
>>>
>>>
>>> But when i try to deploy Bundle1 then I am getting the following
>>> exception,
>>>
>>>        org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>>>
>>> Please suggest a way to come out of this exception, or correct me if
>>> something is wrong in the above manifest.
>>>
>>
>> the problem is because the Felix bundlerepository re-uses the  
>> framework
>> LDAP filter implementation rather than implementing its own filter 
>> +parser
>>
>>  http://issues.apache.org/jira/browse/FELIX-759
>>
>> the OBR RFC states that the OBR filter should accept < and >  
>> operators,
>> but these are not currently supported by the Felix framework filter
>> because
>> the R4 specification did not originally include them as permitted
>> operators
>>
>> so basically, it's a mismatch between the OBR and framework filter  
>> specs
>>
>> another workaround would be to patch bindex (et. al) to avoid using  
>> these
>> operators, but this would be a hack because the OBR spec clearly  
>> allows
>> both < and >, it's just the Felix bundlerepository that doesn't  
>> like them
>>
>> Thanks in advance,
>>> Sriharsha.
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20537950.html
>>> Sent from the Apache Felix - Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>> -- 
>> Cheers, Stuart
>>
>>
>
>
> -----
> Sriharsha
>
> -- 
> View this message in context: http://www.nabble.com/bindex-tool-is-unable-to-retain-the-Require-Bundle-bundle-version-info-in-the-repository.xml-tp20297305p20798030.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org