You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Rob Walker <ro...@ascert.com> on 2010/06/11 12:22:31 UTC

Not getting a BundleException if I install an invalid bundle

Not sure if this is actually normal/correct behaviour, but I have a case 
in our app where a JAR we are installing may not actually be valid OSGi 
bundle i.e it's Manifest has no OSGi headers in it.

I was expecting to be able to detect this either by catching a 
BundleException or a null return from installBundle, but Felix just 
seems to silently load the bundle without error. I can see the JAR in my 
.felix cache.

Anyone know if this is correct? Would have expected some way to detect this?

We're on a trunk version as of a couple of weeks back - haven't tried 
this on latest 3.0 framework yet

Cheers

-- Rob


Ascert - Taking systems to the Edge
robw@ascert.com
+44 (0)20 7488 3470
www.ascert.com


Re: Not getting a BundleException if I install an invalid bundle

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 6/11/10 12:37, Rob Walker wrote:
> Ah - ok, hadn't realised R3 bundles didn't have any validation on 
> them. Assumed it would at least check for some minimum set of headers.

R3 bundles don't have any required headers. R4 bundle only require 
Bundle-ManifestVersion and Bundle-SymbolicName.

-> richard

> Cheers
> - Rob
>
> On 11/06/2010 12:34 PM, Karl Pauls wrote:
>> it is assumed to be an R3 bundle so it doesn't need any metadata - i
>> think Felix is doing the correct thing.
>>
>> regards,
>>
>> Karl
>>
>> On Friday, June 11, 2010, Rob Walker<ro...@ascert.com>  wrote:
>>> Not sure if this is actually normal/correct behaviour, but I have a 
>>> case in our app where a JAR we are installing may not actually be 
>>> valid OSGi bundle i.e it's Manifest has no OSGi headers in it.
>>>
>>> I was expecting to be able to detect this either by catching a 
>>> BundleException or a null return from installBundle, but Felix just 
>>> seems to silently load the bundle without error. I can see the JAR 
>>> in my .felix cache.
>>>
>>> Anyone know if this is correct? Would have expected some way to 
>>> detect this?
>>>
>>> We're on a trunk version as of a couple of weeks back - haven't 
>>> tried this on latest 3.0 framework yet
>>>
>>> Cheers
>>>
>>> -- Rob
>>>
>>>
>>> Ascert - Taking systems to the Edge
>>> robw@ascert.com
>>> +44 (0)20 7488 3470
>>> www.ascert.com
>>>
>>>
>

Re: Not getting a BundleException if I install an invalid bundle

Posted by Rob Walker <ro...@ascert.com>.
Ah - ok, hadn't realised R3 bundles didn't have any validation on them. 
Assumed it would at least check for some minimum set of headers.
Cheers
- Rob

On 11/06/2010 12:34 PM, Karl Pauls wrote:
> it is assumed to be an R3 bundle so it doesn't need any metadata - i
> think Felix is doing the correct thing.
>
> regards,
>
> Karl
>
> On Friday, June 11, 2010, Rob Walker<ro...@ascert.com>  wrote:
>    
>> Not sure if this is actually normal/correct behaviour, but I have a case in our app where a JAR we are installing may not actually be valid OSGi bundle i.e it's Manifest has no OSGi headers in it.
>>
>> I was expecting to be able to detect this either by catching a BundleException or a null return from installBundle, but Felix just seems to silently load the bundle without error. I can see the JAR in my .felix cache.
>>
>> Anyone know if this is correct? Would have expected some way to detect this?
>>
>> We're on a trunk version as of a couple of weeks back - haven't tried this on latest 3.0 framework yet
>>
>> Cheers
>>
>> -- Rob
>>
>>
>> Ascert - Taking systems to the Edge
>> robw@ascert.com
>> +44 (0)20 7488 3470
>> www.ascert.com
>>
>>
>>      
>    

-- 


Ascert - Taking systems to the Edge
robw@ascert.com
+44 (0)20 7488 3470
www.ascert.com


Re: Not getting a BundleException if I install an invalid bundle

Posted by Karl Pauls <ka...@gmail.com>.
it is assumed to be an R3 bundle so it doesn't need any metadata - i
think Felix is doing the correct thing.

regards,

Karl

On Friday, June 11, 2010, Rob Walker <ro...@ascert.com> wrote:
> Not sure if this is actually normal/correct behaviour, but I have a case in our app where a JAR we are installing may not actually be valid OSGi bundle i.e it's Manifest has no OSGi headers in it.
>
> I was expecting to be able to detect this either by catching a BundleException or a null return from installBundle, but Felix just seems to silently load the bundle without error. I can see the JAR in my .felix cache.
>
> Anyone know if this is correct? Would have expected some way to detect this?
>
> We're on a trunk version as of a couple of weeks back - haven't tried this on latest 3.0 framework yet
>
> Cheers
>
> -- Rob
>
>
> Ascert - Taking systems to the Edge
> robw@ascert.com
> +44 (0)20 7488 3470
> www.ascert.com
>
>

-- 
Karl Pauls
karlpauls@gmail.com