You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Sahoo <Sa...@Sun.COM> on 2008/08/09 11:47:47 UTC

Mandatory attribute matching not working for DynamicImport-Package

Hi,

Section #3.8.2 of R4 spec says the following:

/All mandatory arbitrary attributes (as specified by the exporter, see 
Mandatory Attributes on page 45) must be specified in the dynamic import 
definition and match./

I suspect it is *not* working in Felix yet. I am using Felix v1.0.4. 
Mandatory attributes are considered while resolving static imports, but 
not for dynamic imports. I have two bundles that have identical 
contents, except that bundle #10 uses regular import, where as bundle 
#11 uses dynamic import. They both are trying to load a class foo.A. 
Package foo is exported by bundle #12 and it has a mandatory attribute 
defined like this:
/
Export-Package = foo;password=foo;mandatory:=password/

As shown below, when I start bundle #10, I get resolution error, where 
as bundle #11 happily wires to bundle #12.

-> start 10
org.osgi.framework.BundleException: Unresolved package in bundle 10: 
package; (package=foo)
-> start 11
DEBUG: WIRE: 11.0 -> org.osgi.framework -> 0
DEBUG: WIRE: 12.0 -> foo -> 12.0
DEBUG: WIRE: 11.0 -> foo -> 12.0
class foo.A is loaded by 12.0

The diff between manifest files of bundle #10 and #11 is supplied below:

/diff dynamic-importer/target/classes/META-INF/MANIFEST.MF 
static-importer/target/classes/META-INF/MANIFEST.MF
5,6c5,6
< Import-Package: org.osgi.framework;version="1.3"
< Bnd-LastModified: 1218274803828
---
 > Import-Package: foo,org.osgi.framework;version="1.3"
 > Bnd-LastModified: 1218274805799
8c8
< Bundle-Name: dynamic-importer
---
 > Bundle-Name: static-importer
12,13c12,13
< Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.dynamic-impor
<  ter
---
 > Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.static-import
 >  er
15d14
< DynamicImport-Package: */

Is this a known issue?

Thanks,
Sahoo

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


Re: Mandatory attribute matching not working for DynamicImport-Package

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Sahoo wrote:
> DONE: https://issues.apache.org/jira/browse/FELIX-676
>
> I think it is do with the way we are using filters to match. The 
> requirement filter does not know about mandatory attributes, hence it 
> is matching the capability.

Thanks. I will try to look into it this coming week.

-> richard

>
> Thanks,
> Sahoo
>
> Richard S. Hall wrote:
>> It is not a known issue. Please file a JIRA issue and we will look 
>> into it. It shouldn't be the case.
>>
>> Thanks.
>>
>> -> richard
>>
>> Sahoo wrote:
>>> Hi,
>>>
>>> Section #3.8.2 of R4 spec says the following:
>>>
>>> /All mandatory arbitrary attributes (as specified by the exporter, 
>>> see Mandatory Attributes on page 45) must be specified in the 
>>> dynamic import definition and match./
>>>
>>> I suspect it is *not* working in Felix yet. I am using Felix v1.0.4. 
>>> Mandatory attributes are considered while resolving static imports, 
>>> but not for dynamic imports. I have two bundles that have identical 
>>> contents, except that bundle #10 uses regular import, where as 
>>> bundle #11 uses dynamic import. They both are trying to load a class 
>>> foo.A. Package foo is exported by bundle #12 and it has a mandatory 
>>> attribute defined like this:
>>> /
>>> Export-Package = foo;password=foo;mandatory:=password/
>>>
>>> As shown below, when I start bundle #10, I get resolution error, 
>>> where as bundle #11 happily wires to bundle #12.
>>>
>>> -> start 10
>>> org.osgi.framework.BundleException: Unresolved package in bundle 10: 
>>> package; (package=foo)
>>> -> start 11
>>> DEBUG: WIRE: 11.0 -> org.osgi.framework -> 0
>>> DEBUG: WIRE: 12.0 -> foo -> 12.0
>>> DEBUG: WIRE: 11.0 -> foo -> 12.0
>>> class foo.A is loaded by 12.0
>>>
>>> The diff between manifest files of bundle #10 and #11 is supplied 
>>> below:
>>>
>>> /diff dynamic-importer/target/classes/META-INF/MANIFEST.MF 
>>> static-importer/target/classes/META-INF/MANIFEST.MF
>>> 5,6c5,6
>>> < Import-Package: org.osgi.framework;version="1.3"
>>> < Bnd-LastModified: 1218274803828
>>> ---
>>> > Import-Package: foo,org.osgi.framework;version="1.3"
>>> > Bnd-LastModified: 1218274805799
>>> 8c8
>>> < Bundle-Name: dynamic-importer
>>> ---
>>> > Bundle-Name: static-importer
>>> 12,13c12,13
>>> < Bundle-SymbolicName: 
>>> sahoo.dynamic-import-mandatory-attr.dynamic-impor
>>> <  ter
>>> ---
>>> > Bundle-SymbolicName: 
>>> sahoo.dynamic-import-mandatory-attr.static-import
>>> >  er
>>> 15d14
>>> < DynamicImport-Package: */
>>>
>>> Is this a known issue?
>>>
>>> Thanks,
>>> Sahoo
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Mandatory attribute matching not working for DynamicImport-Package

Posted by Sahoo <sa...@sun.com>.
DONE: https://issues.apache.org/jira/browse/FELIX-676

I think it is do with the way we are using filters to match. The 
requirement filter does not know about mandatory attributes, hence it is 
matching the capability.

Thanks,
Sahoo

Richard S. Hall wrote:
> It is not a known issue. Please file a JIRA issue and we will look 
> into it. It shouldn't be the case.
>
> Thanks.
>
> -> richard
>
> Sahoo wrote:
>> Hi,
>>
>> Section #3.8.2 of R4 spec says the following:
>>
>> /All mandatory arbitrary attributes (as specified by the exporter, 
>> see Mandatory Attributes on page 45) must be specified in the dynamic 
>> import definition and match./
>>
>> I suspect it is *not* working in Felix yet. I am using Felix v1.0.4. 
>> Mandatory attributes are considered while resolving static imports, 
>> but not for dynamic imports. I have two bundles that have identical 
>> contents, except that bundle #10 uses regular import, where as bundle 
>> #11 uses dynamic import. They both are trying to load a class foo.A. 
>> Package foo is exported by bundle #12 and it has a mandatory 
>> attribute defined like this:
>> /
>> Export-Package = foo;password=foo;mandatory:=password/
>>
>> As shown below, when I start bundle #10, I get resolution error, 
>> where as bundle #11 happily wires to bundle #12.
>>
>> -> start 10
>> org.osgi.framework.BundleException: Unresolved package in bundle 10: 
>> package; (package=foo)
>> -> start 11
>> DEBUG: WIRE: 11.0 -> org.osgi.framework -> 0
>> DEBUG: WIRE: 12.0 -> foo -> 12.0
>> DEBUG: WIRE: 11.0 -> foo -> 12.0
>> class foo.A is loaded by 12.0
>>
>> The diff between manifest files of bundle #10 and #11 is supplied below:
>>
>> /diff dynamic-importer/target/classes/META-INF/MANIFEST.MF 
>> static-importer/target/classes/META-INF/MANIFEST.MF
>> 5,6c5,6
>> < Import-Package: org.osgi.framework;version="1.3"
>> < Bnd-LastModified: 1218274803828
>> ---
>> > Import-Package: foo,org.osgi.framework;version="1.3"
>> > Bnd-LastModified: 1218274805799
>> 8c8
>> < Bundle-Name: dynamic-importer
>> ---
>> > Bundle-Name: static-importer
>> 12,13c12,13
>> < Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.dynamic-impor
>> <  ter
>> ---
>> > Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.static-import
>> >  er
>> 15d14
>> < DynamicImport-Package: */
>>
>> Is this a known issue?
>>
>> Thanks,
>> Sahoo
>>
>> ---------------------------------------------------------------------
>> 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
>

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


Re: Mandatory attribute matching not working for DynamicImport-Package

Posted by "Richard S. Hall" <he...@ungoverned.org>.
It is not a known issue. Please file a JIRA issue and we will look into 
it. It shouldn't be the case.

Thanks.

-> richard

Sahoo wrote:
> Hi,
>
> Section #3.8.2 of R4 spec says the following:
>
> /All mandatory arbitrary attributes (as specified by the exporter, see 
> Mandatory Attributes on page 45) must be specified in the dynamic 
> import definition and match./
>
> I suspect it is *not* working in Felix yet. I am using Felix v1.0.4. 
> Mandatory attributes are considered while resolving static imports, 
> but not for dynamic imports. I have two bundles that have identical 
> contents, except that bundle #10 uses regular import, where as bundle 
> #11 uses dynamic import. They both are trying to load a class foo.A. 
> Package foo is exported by bundle #12 and it has a mandatory attribute 
> defined like this:
> /
> Export-Package = foo;password=foo;mandatory:=password/
>
> As shown below, when I start bundle #10, I get resolution error, where 
> as bundle #11 happily wires to bundle #12.
>
> -> start 10
> org.osgi.framework.BundleException: Unresolved package in bundle 10: 
> package; (package=foo)
> -> start 11
> DEBUG: WIRE: 11.0 -> org.osgi.framework -> 0
> DEBUG: WIRE: 12.0 -> foo -> 12.0
> DEBUG: WIRE: 11.0 -> foo -> 12.0
> class foo.A is loaded by 12.0
>
> The diff between manifest files of bundle #10 and #11 is supplied below:
>
> /diff dynamic-importer/target/classes/META-INF/MANIFEST.MF 
> static-importer/target/classes/META-INF/MANIFEST.MF
> 5,6c5,6
> < Import-Package: org.osgi.framework;version="1.3"
> < Bnd-LastModified: 1218274803828
> ---
> > Import-Package: foo,org.osgi.framework;version="1.3"
> > Bnd-LastModified: 1218274805799
> 8c8
> < Bundle-Name: dynamic-importer
> ---
> > Bundle-Name: static-importer
> 12,13c12,13
> < Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.dynamic-impor
> <  ter
> ---
> > Bundle-SymbolicName: sahoo.dynamic-import-mandatory-attr.static-import
> >  er
> 15d14
> < DynamicImport-Package: */
>
> Is this a known issue?
>
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> 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