Stuart McCulloch created FELIX-4754:
---------------------------------------

             Summary: OBR parse exception when installing org.jacoco.report 
bundle
                 Key: FELIX-4754
                 URL: https://issues.apache.org/jira/browse/FELIX-4754
             Project: Felix
          Issue Type: Bug
          Components: Bundle Repository (OBR)
    Affects Versions: bundlerepository-2.0.2
            Reporter: Stuart McCulloch


The org.jacoco.report bundle has "bundle-version" attributes on its 
Import-Package clauses which declare version ranges. These are not properly 
handled by DataModelHelperImpl, causing an OBR parse exception after installing 
the org.jacoco.report bundle into the Felix distribution:
{code}
unzip org.apache.felix.main.distribution-4.4.1.zip
cd felix-framework-4.4.1
java -jar bin/felix.jar 
____________________________
Welcome to Apache Felix Gogo

g! install file:/tmp/org.jacoco.report-0.6.2.201302030002.jar
ERROR: Bundle org.apache.felix.bundlerepository [1] EventDispatcher: Error 
during dispatch. (java.lang.IllegalArgumentException)
java.lang.IllegalArgumentException
        at 
org.apache.felix.bundlerepository.impl.RequirementImpl.setFilter(RequirementImpl.java:101)
        at 
org.apache.felix.bundlerepository.impl.DataModelHelperImpl.createImportFilter(DataModelHelperImpl.java:775)
        at 
org.apache.felix.bundlerepository.impl.DataModelHelperImpl.doImports(DataModelHelperImpl.java:738)
        at 
org.apache.felix.bundlerepository.impl.DataModelHelperImpl.populate(DataModelHelperImpl.java:556)
        at 
org.apache.felix.bundlerepository.impl.LocalResourceImpl.initialize(LocalResourceImpl.java:57)
        at 
org.apache.felix.bundlerepository.impl.LocalResourceImpl.<init>(LocalResourceImpl.java:40)
        at 
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.addBundle(LocalRepositoryImpl.java:98)
        at 
org.apache.felix.bundlerepository.impl.LocalRepositoryImpl.bundleChanged(LocalRepositoryImpl.java:54)
        at 
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:869)
        at 
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:790)
        at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515)
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4434)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3056)
        at 
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
        at org.apache.felix.gogo.command.Basic.install(Basic.java:428)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
        at 
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
        at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
        at org.apache.felix.gogo.shell.Console.run(Console.java:62)
        at org.apache.felix.gogo.shell.Shell.console(Shell.java:203)
        at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
        at 
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
        at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
        at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
        at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.InvalidSyntaxException: Extraneous trailing 
characters: (mandatory:<*bundle-version)): 
(&(package=org.jacoco.core)(version>=0.6.2)(!(version>=0.6.3))(bundle-version=[0.6.2,0.6.3))(mandatory:<*bundle-version))
        at 
org.apache.felix.utils.filter.FilterImpl$Parser.parse(FilterImpl.java:1180)
        at 
org.apache.felix.utils.filter.FilterImpl.newInstance(FilterImpl.java:87)
        at 
org.apache.felix.bundlerepository.impl.RequirementImpl.setFilter(RequirementImpl.java:97)
        ... 43 more
Bundle ID: 5
g! 
{code}
Either the DataModelHelperImpl should ignore bundle-version attributes (since 
it doesn't generate associated bundle-version properties on the capabilities of 
exported packages) or it should handle them as a special case and generate the 
correct filter syntax. For the latter case it would also need to generate the 
relevant bundle-version properties on the capabilities of exported packages, 
otherwise these requirements would never be satisfied.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to