If i run bindex tool on say some 5 jars where in Bundle1 and Bundle2 depends
on Bundle3, Bundle4 and Bundle5.

repository.xml generated is simple and and I can add it to OBR url list
using

         obr add-url

 and the application works as expected.


But the problem is with more number of Bundles. I have properly Bundle'ised
3rd party jars (like log4j, spring-osgi jars ) and some of my application
bundles.
When i run bindex to get repository.xml, I am getting proper file.

But when i try to add this reopsitory url to OBR
       
         obr add-url
"http://localhost:8080/Resources/Bundles/repository.xml";

Then I am getting following exception

RepositoryAdminImpl: Exception creating repository -
java.lang.reflect.InvocationTargetException
RepositoryAdminImpl: Ignoring repository
http://localhost:8080/Resources/Bundles/repository.xml
java.lang.NullPointerException
        at
org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1088)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:582)
        at org.apache.felix.framework.Felix._startBundle(Felix.java:1607)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)
        at 
org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java:1135)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:267)
        at java.lang.Thread.run(Unknown Source)

My repository.xml size is 678 KB and I cant trace out any mistakes in this
file(as it is large). But the Bundles for which I am generating
repository.xml are having proper manifest file.

Please suggest a way to come out of this.

Thanks
Sriharsha


Stuart McCulloch wrote:
> 
> 2008/11/17 Sriharsha <[EMAIL PROTECTED]>
> 
>>
>> 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> 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-tp20297305p20674845.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to