You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Dirk Mahler (JIRA)" <ji...@apache.org> on 2008/10/10 14:47:44 UTC

[jira] Created: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Version range in import declaration creates a filter using invalid operators (<,>)
----------------------------------------------------------------------------------

                 Key: FELIX-759
                 URL: https://issues.apache.org/jira/browse/FELIX-759
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-1.4.3
         Environment: Maven Bundle Plugin 1.4.3
Apache Felix Bundle Repository (1.2.0)
Apache Felix 1.2.1/Equinox 3.4.0

            Reporter: Dirk Mahler


If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:

<require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>

These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
The resulting problem are exceptions while reading the repository descriptor:

Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
        at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
        at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
        at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)

A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Atle Prange (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645159#action_12645159 ] 

Atle Prange commented on FELIX-759:
-----------------------------------

Hi,

i am starting to be a heavy felix user, and i think that if the OBR bundle is to be really useful, the Felix filters should at least support the > and < operators. I have taken the liberty of downloading the head and adding the two operators in the o.a.f.framwork.util.ldap.Parser. (See attachment)

One should also have a better strategy when an unparseable filter is encountered, now the OBR bundle just skips the repository. I changed the bundle so that a "impossible" filter is created when an InvalidSyntaxException is encountered: (false=false). Not optimal, but at least i can load the rest of the resources from the repository. 

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR), Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3, bundlerepository-1.2.0
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638553#action_12638553 ] 

Stuart McCulloch commented on FELIX-759:
----------------------------------------

But note that the OBR RFC:

  http://www.osgi.org/download/rfc-0112_BundleRepository.pdf

contains the following sentence:

  "The filter supports now all comparison operators: <, >, >=, <=. The absence of the < and > operators should have been fixed in R4."

so the bundle repository should in theory support < and > (it doesn't at the moment because Felix re-uses the framework filter code)

Changing the local bundleplugin code to avoid using < and > is really a band-aid, and won't help people who use bindex:

  http://www.osgi.org/Repository/BIndex

(which is the original source for the org.osgi.impl.bundle.obr.resource code used in the bundleplugin) or other OBR tools...

Of course, if bindex decided to also not use < or >, and the OBR spec was updated accordingly then that would be a different matter...

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Dirk Mahler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dirk Mahler updated FELIX-759:
------------------------------

    Attachment: BundleInfo.java.diff

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648258#action_12648258 ] 

Richard S. Hall commented on FELIX-759:
---------------------------------------

I will see if I can push on this a little more, since it is cropping up regularly.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR), Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3, bundlerepository-1.2.0
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch updated FELIX-759:
-----------------------------------

          Component/s: Bundle Repository (OBR)
    Affects Version/s: bundlerepository-1.2.0

I can see two options, and would like to hear the views of other Felix devs:

  1)  fix the bundle repository to support < and > (or wait for the framework filters to support < and >)

or

  2)  update RFC 112 to clarify that < and > are not supported, in which case the tools need to change

I'd like to avoid the middle ground where the RFC says < and > are valid, but no-one uses them because they aren't supported in practice.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR), Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3, bundlerepository-1.2.0
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Atle Prange (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Atle Prange updated FELIX-759:
------------------------------

    Attachment: Parser.java

Added org.apache.felix.framework.util.ldap.Parser with added > and < operators.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR), Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3, bundlerepository-1.2.0
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838294#action_12838294 ] 

Guillaume Nodet commented on FELIX-759:
---------------------------------------

Btw, I've just changed the filter implementation used in bundlerepository and it doesn't support '<' and '>' anymore.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated FELIX-759:
----------------------------------

          Component/s:     (was: Bundle Repository (OBR))
                       Maven Bundle Plugin
    Affects Version/s:     (was: bundlerepository-1.2.0)

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838255#action_12838255 ] 

Richard S. Hall edited comment on FELIX-759 at 2/25/10 9:07 AM:
----------------------------------------------------------------

Just as a follow up, since I saw this issue again due to some JIRA change emails...this was discussed in CPEG at one point in time and the idea of adding such operators to Filter was rejected...at least for now.

      was (Author: rickhall):
    Just as a follow up, since I saw this issue due to some JIRA changes...this was discussed in CPEG at one point in time and the idea of adding such operators to Filter was rejected...at least for now.
  
> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart McCulloch updated FELIX-759:
-----------------------------------

          Component/s:     (was: Maven Bundle Plugin)
    Affects Version/s:     (was: maven-bundle-plugin-1.4.3)

Removing this issue from the bundleplugin component because the new Bindex code (updated in trunk) now generates filters that are accepted by the existing OBR implementation. However, I'm leaving this issue open against the bundlerepository component as the version range parser still doesn't accept all the operators listed in the OBR spec.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Bundle Repository (OBR)
>    Affects Versions: bundlerepository-1.2.0
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-759) Version range in import declaration creates a filter using invalid operators (<,>)

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838255#action_12838255 ] 

Richard S. Hall commented on FELIX-759:
---------------------------------------

Just as a follow up, since I saw this issue due to some JIRA changes...this was discussed in CPEG at one point in time and the idea of adding such operators to Filter was rejected...at least for now.

> Version range in import declaration creates a filter using invalid operators (<,>)
> ----------------------------------------------------------------------------------
>
>                 Key: FELIX-759
>                 URL: https://issues.apache.org/jira/browse/FELIX-759
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>         Environment: Maven Bundle Plugin 1.4.3
> Apache Felix Bundle Repository (1.2.0)
> Apache Felix 1.2.1/Equinox 3.4.0
>            Reporter: Dirk Mahler
>         Attachments: BundleInfo.java.diff, Parser.java
>
>
> If a version range is given for an import-declaration (e.g. bundle http://www.springsource.com/repository/app/bundle/version/detail?name=com.springsource.javax.jms&version=1.1.0) the maven bundle plugin creates version filters for the OBR repository which might contain the operators < and >, e.g.:
> <require extend="false" filter="(&amp;(package=javax.transaction.xa)(version&gt;=1.0.1)(version&lt;2.0.0))" multiple="false" name="package" optional="true">Import package javax.transaction.xa ;version=[1.0.1,2.0.0)</require>
> These operators are currently not supported by Felix and Equinox, the OSGi specification (at least 4.0.1) only states "<=" and ">=" as valid ones.
> The resulting problem are exceptions while reading the repository descriptor:
> Caused by: org.osgi.framework.InvalidSyntaxException: expected ~=|>=|<=
>         at org.apache.felix.framework.FilterImpl.<init>(FilterImpl.java:81)
>         at org.apache.felix.framework.BundleContextImpl.createFilter(BundleContextImpl.java:104)
>         at org.apache.felix.bundlerepository.RequirementImpl.setFilter(RequirementImpl.java:57)
> A simple patch for the class org.osgi.impl.bundle.obr.resource.BundleInfo.java is attached to this issue. The solution is to replace (version<2.0.0) by (!(version>=2.0.0))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.