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 > <[email protected]> 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 >> >> >> >>
