Here's the whole story:

the base class has 'package default' access, and the setter is public.
As a result, Java makes a bridge, and blueprint rejects. The setter is
trivial

  public void setRequestType(RequestType requestType) {
    this.requestType = requestType;
  }

Aki Yoshida found:

here is an interesting info on why these public methods from
non-public super classes are marked as bridged.

http://stackoverflow.com/questions/24106486/why-does-the-java-compiler-add-visibility-bridge-methods-for-public-methods-defi

as an explanation.

So, if blueprint is supposed to be able to use public methods of
not-public base classes, then it's got a bug.



On Thu, Sep 3, 2015 at 9:23 AM, Yogesh Rao <[email protected]> wrote:
> Hello,
>
> Can you share the snippet of setRequestTracker method definition ?
>
> Regards,
> -Yogesh
>
> On Thu, Sep 3, 2015 at 1:03 AM, Benson Margulies <[email protected]>
> wrote:
>>
>> Here's a fragment of a blueprint.xml.
>>
>> When I start up, I get:
>>
>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>> Unable to find property descriptor requestTracker on class
>> com.basistech.ws.frontend.service.RaasRsCategorizationService
>>
>> I look around in Karaf, and there is a bundle exporting this interface:
>>
>>  21 | Active   |  80 | 1.5.0.v20150902072220 |
>> rosapi-front-end-null-request-tracker
>> karaf@root>bundle:services 21
>>
>> rosapi-front-end-null-request-tracker (21) provides:
>> ----------------------------------------------------
>> [com.basistech.ws.common.requesttracker.RequestTracker]
>> [org.osgi.service.blueprint.container.BlueprintContainer]
>>
>> So what's Aries' beef?
>>
>> Note that setRequestTracker is defined on a class that
>> RaasRsCategorizationService inherits from.
>>
>>
>> <reference id="tracker"
>> interface="com.basistech.ws.common.requesttracker.RequestTracker"/>
>> <!-- some day properties to tell which transport when we have more than
>> one -->
>> <reference id="transport"
>> interface="com.basistech.ws.frontend.api.Transport"/>
>>
>> <!-- This is the moment when we might wish for annotations instead of
>> plain old blueprint -->
>> <bean id="categorization"
>> class="com.basistech.ws.frontend.service.RaasRsCategorizationService">
>>     <property name="requestTracker" ref="tracker"/>
>>     <property name="transport" ref="transport"/>
>> </bean>
>
>

Reply via email to