You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aries.apache.org by Tomasz Chodakowski <ch...@wp.eu> on 2010/07/19 17:04:20 UTC

Aries-blueprint not injecting properties with overloaded setter methods(?)

Hello,

 I've tried deploying simple blueprint-enabled bundle, however it looks 
like Aries blueprint implementation fails to inject a property with 
overloaded setter method. I am getting following error:

[Blueprint Extender: 3] ERROR 
org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to 
start blueprint container for bundle Fusion-RESTApp
org.osgi.service.blueprint.container.ComponentDefinitionException: 
Unable to find property descriptor inboundRoot2 on class 
com.ovi.music.fusion.rest.app.RestApplication
        at 
org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:799)
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:765)
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:742)
        at 
org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:723)
        (...)

with the property setters listed below:

    public void setInboundRoot2(Restlet inboundRoot) {
     (...)
    }
    
    public void setInboundRoot2(int i) {
     (...)
   }


 The situation doesn't seem to depend on these particular signatures it's 
the fact that the setter method is overloaded that causes problems. It 
works otherwise (ie: when setter method is not overloaded).

 Is this a bug or just me?

Tomasz



Re: Aries-blueprint not injecting properties with overloaded setter methods(?)

Posted by Tomasz Chodakowski <ch...@wp.eu>.
Thanks for clarifications. Raised bug [1]. Allowed myself to suggest 
following the spring3 approach - I would expect it to be the most common 
migration path for Blueprint users. It was my case and got surprised 
when it didn't work (even though that's what one should be expecting 
from Java Beans spec.)

Tomasz

[1] https://issues.apache.org/jira/browse/ARIES-366

Dnia 19-07-2010 o godz. 20:09 Valentin Mahrwald napisał(a):
> Hi Jarek,
> 
> thanks for pointing this out. I thought briefly about checking the EE
> spec, but thought this couldn't possibly have changed ;)
> 
> I guess if I read this correctly, with the errata we are free to
> implement something more clever.
> 
> @Tomasz: could you raise a bug for this?
> 
> Regards,
> 
> Valentin
> 
> 
> On 19 Jul 2010, at 19:03, Jarek Gawor wrote:
> 
> > Valentin,
> > 
> > I think you're reading the compendium spec. This requirement has been
> > relaxed. See the errata for 4.2 or the same section in the enterprise
> > spec. It now says: "There should only be one set method with a single
> > argument for a specific property. If overloaded properties are
> > encountered, the chosen set method is unspecified."
> > 
> > So I guess we might need to update the Blueprint code.
> > 
> > Jarek
> > 
> > On Mon, Jul 19, 2010 at 1:45 PM, Valentin Mahrwald
> > <vm...@googlemail.com> wrote:
> >> Hi Tomasz,
> >> I had a look through the spec and it is unfortunately quite explicit in
> >> ruling out your scenario :(
> >> From the spec (121.5.7):
> >> name &#65533;The name of the bean property. This name refers to the set 
method
> on
> >> the constructed object as specified in the design pattern for
> >> beans getters and setters, see [6] Java Beans Specification. For
> example, if
> >> the property name is foo, then the public method setFoo(arg) will be
> used to
> >> set the value. There must only be one set method with a single argument
> for
> >> a specific property, that is, overloading of properties is not allowed.
> >> 
> >> So the behaviour is correct and not a bug I think.
> >> Regards,
> >> Valentin
> >> 
> >> On 19 Jul 2010, at 16:04, Tomasz Chodakowski wrote:
> >> 
> >> Hello,
> >> 
> >> I've tried deploying simple blueprint-enabled bundle, however it looks
> >> like Aries blueprint implementation fails to inject a property with
> >> overloaded setter method. I am getting following error:
> >> 
> >> [Blueprint Extender: 3] ERROR
> >> org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to
> >> start blueprint container for bundle Fusion-RESTApp
> >> org.osgi.service.blueprint.container.ComponentDefinitionException:
> >> Unable to find property descriptor inboundRoot2 on class
> >> com.ovi.music.fusion.rest.app.RestApplication
> >>        at
> >> org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:799)
> >>        at
> >> org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:765)
> >>        at
> >> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:742)
> >>        at
> >> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:723)
> >>        (...)
> >> 
> >> with the property setters listed below:
> >> 
> >>    public void setInboundRoot2(Restlet inboundRoot) {
> >>     (...)
> >>    }
> >> 
> >>    public void setInboundRoot2(int i) {
> >>     (...)
> >>   }
> >> 
> >> 
> >> The situation doesn't seem to depend on these particular signatures it's
> >> the fact that the setter method is overloaded that causes problems. It
> >> works otherwise (ie: when setter method is not overloaded).
> >> 
> >> Is this a bug or just me?
> >> 
> >> Tomasz
> >> 
> >> 
> >> 
> >>



Re: Aries-blueprint not injecting properties with overloaded setter methods(?)

Posted by Valentin Mahrwald <vm...@googlemail.com>.
Hi Jarek,

thanks for pointing this out. I thought briefly about checking the EE spec, but thought this couldn't possibly have changed ;)

I guess if I read this correctly, with the errata we are free to implement something more clever.

@Tomasz: could you raise a bug for this?

Regards,

Valentin


On 19 Jul 2010, at 19:03, Jarek Gawor wrote:

> Valentin,
> 
> I think you're reading the compendium spec. This requirement has been
> relaxed. See the errata for 4.2 or the same section in the enterprise
> spec. It now says: "There should only be one set method with a single
> argument for a specific property. If overloaded properties are
> encountered, the chosen set method is unspecified."
> 
> So I guess we might need to update the Blueprint code.
> 
> Jarek
> 
> On Mon, Jul 19, 2010 at 1:45 PM, Valentin Mahrwald
> <vm...@googlemail.com> wrote:
>> Hi Tomasz,
>> I had a look through the spec and it is unfortunately quite explicit in
>> ruling out your scenario :(
>> From the spec (121.5.7):
>> name – The name of the bean property. This name refers to the set method on
>> the constructed object as specified in the design pattern for
>> beans getters and setters, see [6] Java Beans Specification. For example, if
>> the property name is foo, then the public method setFoo(arg) will be used to
>> set the value. There must only be one set method with a single argument for
>> a specific property, that is, overloading of properties is not allowed.
>> 
>> So the behaviour is correct and not a bug I think.
>> Regards,
>> Valentin
>> 
>> On 19 Jul 2010, at 16:04, Tomasz Chodakowski wrote:
>> 
>> Hello,
>> 
>> I've tried deploying simple blueprint-enabled bundle, however it looks
>> like Aries blueprint implementation fails to inject a property with
>> overloaded setter method. I am getting following error:
>> 
>> [Blueprint Extender: 3] ERROR
>> org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to
>> start blueprint container for bundle Fusion-RESTApp
>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>> Unable to find property descriptor inboundRoot2 on class
>> com.ovi.music.fusion.rest.app.RestApplication
>>        at
>> org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:799)
>>        at
>> org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:765)
>>        at
>> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:742)
>>        at
>> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:723)
>>        (...)
>> 
>> with the property setters listed below:
>> 
>>    public void setInboundRoot2(Restlet inboundRoot) {
>>     (...)
>>    }
>> 
>>    public void setInboundRoot2(int i) {
>>     (...)
>>   }
>> 
>> 
>> The situation doesn't seem to depend on these particular signatures it's
>> the fact that the setter method is overloaded that causes problems. It
>> works otherwise (ie: when setter method is not overloaded).
>> 
>> Is this a bug or just me?
>> 
>> Tomasz
>> 
>> 
>> 
>> 


Re: Aries-blueprint not injecting properties with overloaded setter methods(?)

Posted by Jarek Gawor <jg...@gmail.com>.
Valentin,

I think you're reading the compendium spec. This requirement has been
relaxed. See the errata for 4.2 or the same section in the enterprise
spec. It now says: "There should only be one set method with a single
argument for a specific property. If overloaded properties are
encountered, the chosen set method is unspecified."

So I guess we might need to update the Blueprint code.

Jarek

On Mon, Jul 19, 2010 at 1:45 PM, Valentin Mahrwald
<vm...@googlemail.com> wrote:
> Hi Tomasz,
> I had a look through the spec and it is unfortunately quite explicit in
> ruling out your scenario :(
> From the spec (121.5.7):
> name – The name of the bean property. This name refers to the set method on
> the constructed object as specified in the design pattern for
> beans getters and setters, see [6] Java Beans Specification. For example, if
> the property name is foo, then the public method setFoo(arg) will be used to
> set the value. There must only be one set method with a single argument for
> a specific property, that is, overloading of properties is not allowed.
>
> So the behaviour is correct and not a bug I think.
> Regards,
> Valentin
>
> On 19 Jul 2010, at 16:04, Tomasz Chodakowski wrote:
>
> Hello,
>
> I've tried deploying simple blueprint-enabled bundle, however it looks
> like Aries blueprint implementation fails to inject a property with
> overloaded setter method. I am getting following error:
>
> [Blueprint Extender: 3] ERROR
> org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to
> start blueprint container for bundle Fusion-RESTApp
> org.osgi.service.blueprint.container.ComponentDefinitionException:
> Unable to find property descriptor inboundRoot2 on class
> com.ovi.music.fusion.rest.app.RestApplication
>        at
> org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:799)
>        at
> org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:765)
>        at
> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:742)
>        at
> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:723)
>        (...)
>
> with the property setters listed below:
>
>    public void setInboundRoot2(Restlet inboundRoot) {
>     (...)
>    }
>
>    public void setInboundRoot2(int i) {
>     (...)
>   }
>
>
> The situation doesn't seem to depend on these particular signatures it's
> the fact that the setter method is overloaded that causes problems. It
> works otherwise (ie: when setter method is not overloaded).
>
> Is this a bug or just me?
>
> Tomasz
>
>
>
>

Re: Aries-blueprint not injecting properties with overloaded setter methods(?)

Posted by Valentin Mahrwald <vm...@googlemail.com>.
Hi Tomasz,

I had a look through the spec and it is unfortunately quite explicit in ruling out your scenario :(

From the spec (121.5.7):

name – The name of the bean property. This name refers to the set method on the constructed object as specified in the design pattern for
beans getters and setters, see [6] Java Beans Specification. For example, if the property name is foo, then the public method setFoo(arg) will be used to set the value. There must only be one set method with a single argument for a specific property, that is, overloading of properties is not allowed.


So the behaviour is correct and not a bug I think.

Regards,

Valentin


On 19 Jul 2010, at 16:04, Tomasz Chodakowski wrote:

> Hello,
> 
> I've tried deploying simple blueprint-enabled bundle, however it looks 
> like Aries blueprint implementation fails to inject a property with 
> overloaded setter method. I am getting following error:
> 
> [Blueprint Extender: 3] ERROR 
> org.apache.aries.blueprint.container.BlueprintContainerImpl - Unable to 
> start blueprint container for bundle Fusion-RESTApp
> org.osgi.service.blueprint.container.ComponentDefinitionException: 
> Unable to find property descriptor inboundRoot2 on class 
> com.ovi.music.fusion.rest.app.RestApplication
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.getPropertyDescriptor(BeanRecipe.java:799)
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:765)
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:742)
>        at 
> org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:723)
>        (...)
> 
> with the property setters listed below:
> 
>    public void setInboundRoot2(Restlet inboundRoot) {
>     (...)
>    }
> 
>    public void setInboundRoot2(int i) {
>     (...)
>   }
> 
> 
> The situation doesn't seem to depend on these particular signatures it's 
> the fact that the setter method is overloaded that causes problems. It 
> works otherwise (ie: when setter method is not overloaded).
> 
> Is this a bug or just me?
> 
> Tomasz
> 
>